Unable to destroy activity:android.content.res.Resources$NotFoundException: Resource ID #0x7f0c000a

android studio运行项目报错,信息如下:

 

04-17 11:16:11.756 800-800/xxx E/CrashReport: java.lang.RuntimeException: Unable to destroy activity {xxx.home.HomePageActivity}: android.content.res.Resources$NotFoundException: Resource ID #0x7f0c000a
        at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4273)
        at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4291)
        at android.app.ActivityThread.-wrap7(ActivityThread.java)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1649)
        at android.os.Handler.dispatchMessage(Handler.java:111)
        at android.os.Looper.loop(Looper.java:207)
        at android.app.ActivityThread.main(ActivityThread.java:5975)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)
     Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x7f0c000a
        at android.content.res.Resources.getValue(Resources.java:1654)
        at android.content.res.Resources.getDrawable(Resources.java:982)
        at android.support.v4.content.res.ResourcesCompat.getDrawable(ResourcesCompat.java:82)
        at com.bumptech.glide.load.resource.drawable.DrawableDecoderCompat.loadDrawableV4(DrawableDecoderCompat.java:76)
        at com.bumptech.glide.load.resource.drawable.DrawableDecoderCompat.getDrawable(DrawableDecoderCompat.java:64)
        at com.bumptech.glide.load.resource.drawable.DrawableDecoderCompat.getDrawable(DrawableDecoderCompat.java:41)
        at com.bumptech.glide.request.SingleRequest.loadDrawable(SingleRequest.java:402)
        at com.bumptech.glide.request.SingleRequest.getPlaceholderDrawable(SingleRequest.java:383)
        at com.bumptech.glide.request.SingleRequest.clear(SingleRequest.java:333)
        at com.bumptech.glide.manager.RequestTracker.clearRemoveAndMaybeRecycle(RequestTracker.java:79)
        at com.bumptech.glide.manager.RequestTracker.clearRemoveAndRecycle(RequestTracker.java:66)
        at com.bumptech.glide.RequestManager.untrack(RequestManager.java:630)
        at com.bumptech.glide.RequestManager.untrackOrDelegate(RequestManager.java:598)
        at com.bumptech.glide.RequestManager.clear(RequestManager.java:594)
        at com.bumptech.glide.RequestManager.onDestroy(RequestManager.java:339)
        at com.bumptech.glide.manager.ActivityFragmentLifecycle.onDestroy(ActivityFragmentLifecycle.java:65)
        at com.bumptech.glide.manager.SupportRequestManagerFragment.onDestroy(SupportRequestManagerFragment.java:194)
        at android.support.v4.app.Fragment.performDestroy(Fragment.java:2699)
        at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1591)
        at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1784)
        at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1852)
        at android.support.v4.app.FragmentManagerImpl.dispatchStateChange(FragmentManager.java:3269)
        at android.support.v4.app.FragmentManagerImpl.dispatchDestroy(FragmentManager.java:3260)
        at android.support.v4.app.FragmentController.dispatchDestroy(FragmentController.java:274)
        at android.support.v4.app.FragmentActivity.onDestroy(FragmentActivity.java:419)
        at android.support.v7.app.AppCompatActivity.onDestroy(AppCompatActivity.java:210)
        at me.yokeyword.fragmentation.SupportActivity.onDestroy(SupportActivity.java:51)
        at xxx.home.HomePageActivity.onDestroy(HomePageActivity.kt:299)
        at android.app.Activity.performDestroy(Activity.java:6486)
        at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1149)
        at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4260)
        at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4291) 
        at android.app.ActivityThread.-wrap7(ActivityThread.java) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1649) 
        at android.os.Handler.dispatchMessage(Handler.java:111) 
        at android.os.Looper.loop(Looper.java:207) 
        at android.app.ActivityThread.main(ActivityThread.java:5975) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679) 
04-17 11:16:11.756 800-800/xxx E/CrashReport: #++++++++++++++++++++++++++++++++++++++++++#

 

定位到代码中报错位置:

 

Unable to destroy activity:android.content.res.Resources$NotFoundException: Resource ID #0x7f0c000a_第1张图片

 

很明显,资源报错。那就去R文件中查找这个资源id —— #0x7f0c000a。

Unable to destroy activity:android.content.res.Resources$NotFoundException: Resource ID #0x7f0c000a_第2张图片

 

项目中没有使用ic_launcher_round这个资源,所以找到它,删除,然后重新编译,通过。

 

你可能感兴趣的:(Android)