Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setIcon crash #78

Closed
liangweihao opened this issue Jul 24, 2017 · 5 comments
Closed

setIcon crash #78

liangweihao opened this issue Jul 24, 2017 · 5 comments

Comments

@liangweihao
Copy link

ndroid.content.res.Resources$NotFoundException: File res/drawable-xxhdpi-v4/ 4.4.2 huawei crash

@kpmmmurphy
Copy link
Collaborator

I'll need some more detail on this. Can you post the code where you're invoking the Alerter please.

@sergii-frost
Copy link

I had the same issue, it is happening on Android 4.x - 5.x

That is happening in case if you try to use .png as a drawable.

@liangweihao if you switch to .svg instead (Android Studio supports .svg for import as Vector Assets), and do a bit of additional setup in the project to be backwards compatible with Vector drawables, you will get it working.

Changes needed in project to work on older Android versions:

  1. build.gradle
defaultConfig {
    vectorDrawables.useSupportLibrary = true
}
  1. YourApp class (which extends Application)
//in onCreate() method
AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);

@sergii-frost
Copy link

@kpmmmurphy I have a question to you as well, please let me know if I should have a separate issue for it, but is it possible to change colour for the icon itself?

I have a need to have light background for the Alerter message, but icon is always white, even if I explicitly use coloured drawable resource.

@sijojosep
Copy link

I had the same issue .

NotFoundException for com.aitrich.android.orderpro
android.content.res.Resources$NotFoundException: File res/drawable-xxhdpi-v4/ic_map_marker_white_48dp.png from xml type xml resource ID #0x7f020102

@kpmmmurphy
Copy link
Collaborator

I've updated this in version 2.0.1. @sergii-frost no support for this, but feel free to prepare a PR and I'll review it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants