Issue
I have 5 crashes in Crashlytics. 2x in Resources.java and 3x in ResourcesImpl:
- 5 events 2 users Resources.java line 1266 - Android 5.1
- 5 events 1 user ResourcesImpl.java line 215 - Android 8.1.0
- 4 events 1 user Resources.java line 1351 - Android 6.0.1
- 2 events 1 user ResourcesImpl.java line 195 - Android 8.0.0
- 2 events 2 users ResourcesImpl.java line 190 - Android 7.1.1
I cannot see where it goes wrong in the code, given Resources.java is an Android SDK file. I do have a couple of places where Resources is being called:
someText = getContext().getResources().getString(R.string.debug_loading);
bitmap = BitmapFactory.decodeResource(applicationContext.resources, R.mipmap.ic_launcher)
And I've added everywhere this is being called below code:
Bitmap bitmap = null;
try {
bitmap = BitmapFactory.decodeResource(context.getResources(), R.mipmap.ic_launcher);
} catch (Resources.NotFoundException e) {
e.printStackTrace();
}
Is this the right approach since we cannot reverse engineer the Resource ID and thus don't know where exactly the problem is happening?
Solution
Can you confirm if this belongs to only Android OS 5 and 5.1, if yes then it seems to be a bug with androidx.appcompat 1.1.0
Ref: - https://issuetracker.google.com/issues/141132133
Try downgrading to androidx.appcompat:appcompat:1.0.2 once if it gets resolved
Answered By - Dishant Walia
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.