You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Android项目运行触发Resources$NotFoundException,已尝试清理重启仍未解决

Fixing Resources$NotFoundException in Your Android Project

Hey there, I get it—this resource not found error can be super frustrating, especially after you’ve already tried cleaning the project and restarting the app. Let’s break down how to fix this step by step.

First, let’s recap the error you’re seeing:

03-19 14:57:58.523 22517-22517/com.example.vrindabhatt.wall_app E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.vrindabhatt.wall_app, PID: 22517 android.content.res.Resources$NotFoundException: Resource ID #0x7f07007a at android.content.res.Resources.getValue(Resources.java:2345) at android.support.v7.widget.AppCompatDrawableManager.loadDrawableFromDelegates(AppCompatDrawableManager.java:330) at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager....

Here’s what you can try next:

  • Find out what resource ID #0x7f07007a corresponds to
    Open your project’s auto-generated R.java file (you can find it under build/generated/source/r/debug/com.example.vrindabhatt.wall_app/) and search for 0x7f07007a. This will tell you exactly which resource is missing—whether it’s a drawable, layout, string, or something else. Alternatively, use Android Studio’s double-Shift search to look up the resource ID directly.

  • Verify the missing resource exists and is valid

    • If it’s a drawable: Check if the image file is present in the correct drawable-* folders. Make sure the filename uses only lowercase letters, numbers, and underscores (Android is strict about this). Also, ensure the resource isn’t accidentally deleted or moved to the wrong directory.
    • If it’s a layout/string: Confirm the file exists in res/layout or res/values, and that there are no syntax errors inside the file that might prevent it from being compiled.
  • Check for incorrect resource references
    Go through your code and layout files to make sure you’re referencing the right resource ID. Sometimes a typo or copy-paste error can lead to referencing a resource that doesn’t exist. For example, if you changed a resource name but forgot to update all references to it.

  • Do a deep clean and rebuild
    Beyond the basic "Clean Project", try these steps:

    1. Go to File > Invalidate Caches / Restart in Android Studio—this clears out cached data that might be causing conflicts.
    2. Delete the entire build folder in your project directory, then click File > Sync Project with Gradle Files to regenerate all build files from scratch.
  • Check for dependency resource conflicts
    If you’re using third-party libraries, there’s a chance their resource IDs are conflicting with yours. Try updating all your dependencies to their latest versions, or check if any library is defining a resource with the same name as yours.

Give these steps a shot—usually one of them will resolve the issue. Let me know if you hit any snags!

内容的提问来源于stack exchange,提问作者Harsh Patel

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 11:12:46