Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resources$NotFoundException on Samsung

One of my app is crashing on Samsung S5 (SM G900V to be precise) with this exception:

android.content.res.Resources$NotFoundException: File res/drawable-xxhdpi-v4/common_signin_btn_icon_disabled_focus_light.9.png from drawable resource ID #0x7f0200e5
   at android.content.res.Resources$CRunnable_openmp.doOpenMP(Resources.java:1097)
   at android.content.res.Resources$__ompClass0.__doWork(Resources.java:1029)
   at com.samsung.javaomp.runtime.__OMPThread.run()
Caused by: java.io.FileNotFoundException: res/drawable-xxhdpi-v4/common_signin_btn_icon_disabled_focus_light.9.png
   at android.content.res.AssetManager.openNonAssetNative(AssetManager.java)
   at android.content.res.AssetManager.openNonAsset(AssetManager.java:408)
   at android.content.res.Resources$CRunnable_openmp.doOpenMP(Resources.java:1092)
   at android.content.res.Resources$__ompClass0.__doWork(Resources.java:1029)
   at com.samsung.javaomp.runtime.__OMPThread.run()

Seems like app is unable to access some drawable from android OS. Any ideas how to solve it?

UPDATE: May be this part is causing it but again its just a guess:

Integer resultCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
if (resultCode == ConnectionResult.SERVICE_MISSING ||
        resultCode == ConnectionResult.SERVICE_DISABLED ||
        resultCode == ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED) {
    Dialog dialog = GooglePlayServicesUtil.getErrorDialog(resultCode, this, 0);
    if (dialog != null) {
        //This dialog will help the user update to the latest GooglePlayServices
        dialog.show();
    }
}

UPDATE: Unzipping apk file reveals this file res\drawable-xxhdpi-v4\common_signin_btn_icon_disabled_focus_light.9.png

enter image description here

like image 976
M-WaJeEh Avatar asked Mar 11 '15 10:03

M-WaJeEh


1 Answers

It may be related to a bug in Android Gradle plugin <= 1.1.0: https://code.google.com/p/android/issues/detail?id=79325

Meanwhile, you can flip shrinkResources to false and the problem will be solved.

like image 85
Yair Kukielka Avatar answered Oct 07 '22 19:10

Yair Kukielka