Resources$NotFoundException on Samsung


November 2018


2.2k time


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(
   at android.content.res.Resources$__ompClass0.__doWork(
Caused by: res/drawable-xxhdpi-v4/common_signin_btn_icon_disabled_focus_light.9.png
   at android.content.res.AssetManager.openNonAssetNative(
   at android.content.res.AssetManager.openNonAsset(
   at android.content.res.Resources$CRunnable_openmp.doOpenMP(
   at android.content.res.Resources$__ompClass0.__doWork(

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;

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


Это может быть связано с ошибкой в Android Gradle плагин <= 1.1.0:

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


Как сказал здесь pvin ... @ попробуйте отключить shringResources в Gradle файле:

shrinkResources false