18

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

M-Wajeeh
  • 17,204
  • 10
  • 66
  • 103
  • Do you have a common_signin_btn_icon_disabled_focus_light.9.png file in the res/drawable-xxhdpi-v4 directory? – mach Mar 11 '15 at 10:09
  • I don't have a `drawable-xxhdpi-v4` directory in first place. Searching for `common_signin_btn_icon_disabled_focus_light.9.png` on Google makes me feel that this is some internal resource accessed by Google play services. – M-Wajeeh Mar 11 '15 at 10:14
  • do You have Admob inside Your app and obfuscated with ProGuard? – Opiatefuchs Mar 11 '15 at 10:16
  • Yea, seems like the app is using a really old support library and that the Google play services has deprecated it for higher resolutions. You cannot upgrade from android.support.v4.app? – mach Mar 11 '15 at 10:17
  • @Opiatefuchs Nope, I don't have any ad related thing inside app. – M-Wajeeh Mar 11 '15 at 10:17
  • ok, but You are using play services? because this missed png is part of the google play services sdk – Opiatefuchs Mar 11 '15 at 10:19
  • @Opiatefuchs The only place where I am accessing Google Play Services is those lines I just edited in question. – M-Wajeeh Mar 11 '15 at 10:22
  • so You must have integrated google play service sdk, or? it doesn´t matter where You using it. I saw on my samsung galaxy s3 some different behaviour, similar to Yours. If am wright and You have integrated gps sdk, can You open this bug related folder and look if this pic is inside? It must be anywhere under libs.... – Opiatefuchs Mar 11 '15 at 10:30
  • @Opiatefuchs I have just uncompressed final apk file and there is indeed a file `res\drawable-xxhdpi-v4\common_signin_btn_icon_disabled_focus_light.9.png` – M-Wajeeh Mar 11 '15 at 10:41
  • 1
    The question is whether the index in the `R.java` corresponds to it properly, the resource ID i mean. – EpicPandaForce Mar 11 '15 at 10:46
  • @EpicPandaForce If something was wrong with `R.java` then app should crash on every device whereas app crashes only on Samsung devices, most prominently on SM G900V. – M-Wajeeh Mar 11 '15 at 10:49
  • not necessarily...this relates to how samsung has done their android port...example: I had two string folders, one german, one default. I put some strings inside default string.file but forget it to put it into german one. While other devices put the String from the default string resources, samsung s3 failed to get this.... – Opiatefuchs Mar 11 '15 at 10:52
  • I think a try could be to remove the google play service sdk, attach it again and clean the project.... – Opiatefuchs Mar 11 '15 at 10:54
  • But I can't just reproduce it, I am receiving these crash reports whereas app works fine for me on same device. – M-Wajeeh Mar 11 '15 at 10:55
  • Same is happening for me, I opened here http://developer.samsung.com/forum/board/thread/view.do?boardName=General&messageId=284984&listLines=15&startId=zzzzz~ and here https://code.google.com/p/android/issues/detail?id=186013 – Daniel Gomez Rico Sep 11 '15 at 20:35
  • I'm facing this issue 2 years later in 2017. Samsung is such a piece of shit! I Had to say it. – frankelot Jan 22 '17 at 20:31
  • Issue still exists – Yasiru Nayanajith Aug 12 '22 at 14:08

2 Answers2

4

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.

Yair Kukielka
  • 10,686
  • 1
  • 38
  • 46
0

As pvin...@gmail said here https://code.google.com/p/android/issues/detail?id=186013 try disabling shringResources in the gradle file:

shrinkResources false

Daniel Gomez Rico
  • 15,026
  • 20
  • 92
  • 162