简体   繁体   中英

My Android App bug on load ressource only in production

I have a bug in my Android Java application only in production.

When I publish my application to my phone with Android Studio, all is working fine.

When I update this application by the Play Store on the same phone, I have this error:

Process: com.iddeos.planningbuilder, PID: 31989
android.content.res.Resources$NotFoundException: Resource ID #0x0

Bug provides from this line, but I don't understand why

int iconRessource = getResources().getIdentifier("drawable/"+menu.getIcon(), "drawable", getPackageName());
Drawable image = ContextCompat.getDrawable(getApplicationContext(), iconRessource);
menuBottomConfig.add(android.view.Menu.NONE, menu.getId(), android.view.Menu.NONE, menu.getTitle()).setIcon(image);

I have foud the solution.

Bugs not provide from ressource but by obfuscation mod. Because GSON not working correctly in this mod.

A add proguard rules and its working now.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM