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?