当前位置: 代码迷 >> Android >> Resources$NotFoundException 有关问题如何解决
  详细解决方案

Resources$NotFoundException 有关问题如何解决

热度:108   发布时间:2016-05-01 17:58:31.0
Resources$NotFoundException 问题怎么解决
我在 ubuntu 下面编译系统,然后烧进板子里面,系统正常运行,但是有几个apk不能打开,Phone.apk ,Music.apk, Contacts.apk 这几个不能打开,我裁减了一些 apk,桌面上剩下 五个 apk,Settings 是可以正常运行。
报出错误:
Java code
E/AndroidRuntime( 2516): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.music/com.android.music.ArtistAlbumBrowserActivity}: android.chub 1-0:1.0: unable to enumerate USB device on port 1ontent.res.Resources$NotFoundException: Resource ID #0x7f030009E/AndroidRuntime( 2516):     at android.app.ActivityThread.performlis3dh_acc: hw init doneLaunchActivity(ActivityThread.java:1647)E/AndroidRuntime( 2516):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)E/AndroidRuntime( 2516):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)E/AndroidRuntime( 2516):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)E/AndroidRuntime( 2516):     at android.os.Handler.dispatchMessage(Handler.java:99)E/AndroidRuntime( 2516):     at android.os.Looper.loop(Looper.java:130)E/AndroidRuntime( 2516):     at android.app.ActivityThread.main(ActivityThread.java:3683)E/AndroidRuntime( 2516):     at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime( 2516):     at java.lang.reflect.Method.invoke(Method.java:507)E/AndroidRuntime( 2516):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)E/AndroidRuntime( 2516):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)E/AndroidRuntime( 2516):     at dalvik.system.NativeStart.main(Native Method)E/AndroidRuntime( 2516): Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x7f030009E/AndroidRuntime( 2516):     at android.content.res.Resources.getValue(Resources.java:892)E/AndroidRuntime( 2516):     at android.content.res.Resources.loadXmlResourceParser(Resources.java:1869)E/AndroidRuntime( 2516):     at android.content.res.Resources.getLayout(Resources.java:731)E/AndroidRuntime( 2516):     at android.view.LayoutInflater.inflate(LayoutInflater.java:318)E/AndroidRuntime( 2516):     at android.view.LayoutInflater.inflate(LayoutInflater.java:276)E/AndroidRuntime( 2516):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:207)E/AndroidRuntime( 2516):     at android.app.Activity.setContentView(Activity.java:1657)E/AndroidRuntime( 2516):     at com.android.music.ArtistAlbumBrowserActivity.onCreate(ArtistAlbumBrowserActivity.java:106)E/AndroidRuntime( 2516):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)E/AndroidRuntime( 2516):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)E/AndroidRuntime( 2516):     ... 11 moreW/ActivityManager( 2271):   Force finishing activity com.android.music/.ArtistAlbumBrowserActivityW/ActivityManager( 2271): Activity pause timeout for HistoryRecord{2b0e0120 com.android.musisuspend: exit suspend, ret = 0 (1970-01-02 00:07:30.312312385 UTC)


我在源码中看中间产物,可以看到资源文件,系统可以正常编译。
请问这个该怎么解决。

------解决方案--------------------
编译方法不对?代码中没直接用到的资源文件没编译进去?
------解决方案--------------------
不同版本的SDK可能会导致编译时旧版本下的资源文件未编译进去,你把apk文件拷贝出来,然后改名.zip,解压缩后看看是否有资源文件存在。
  相关解决方案