三星资源$ NotFoundException

时间:2015-03-11 10:06:37

标签: android drawable samsung-mobile

我的一个应用程序崩溃在三星S5(准确地说是SM G900V)上有这样的例外:

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()

似乎app无法从Android操作系统访问一些drawable。任何想法如何解决?

更新:可能是这部分导致了它,但它只是一个猜测:

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();
    }
}

更新:解压缩apk文件显示此文件res\drawable-xxhdpi-v4\common_signin_btn_icon_disabled_focus_light.9.png

enter image description here

2 个答案:

答案 0 :(得分:4)

它可能与Android Gradle插件中的错误有关< = 1.1.0: https://code.google.com/p/android/issues/detail?id=79325

同时,你可以将shrinkResources翻转为false,问题就会解决。

答案 1 :(得分:0)

正如pvin ... @gmail在这里说https://code.google.com/p/android/issues/detail?id=186013尝试禁用gradle文件中的shringResources:

shrinkResources false