Resources$NotFoundException on Samsung

Refresh

November 2018

Views

2.2k time

15

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

2 answers

4

Это может быть связано с ошибкой в Android Gradle плагин <= 1.1.0: https://code.google.com/p/android/issues/detail?id=79325

В то же время, вы можете перевернуть shrinkResources ложь, и проблема будет решена.

0

Как сказал здесь pvin ... @ gmail.com https://code.google.com/p/android/issues/detail?id=186013 попробуйте отключить shringResources в Gradle файле:

shrinkResources false