# android.content.res.Resources$NotFoundException: Resource ID #0x7f0a000b type #0x12 is not valid

- **ID:** `android/resource-not-found-in-package`
- **Domain:** android
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 90%

## Root Cause

A resource ID is referenced at runtime but the resource has been removed, renamed, or is in a different configuration (e.g., layout-land vs layout-port) that is not present in the current APK.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Android 5.0 - 14 | active | — | — |
| AndroidX 1.0 - 1.7 | active | — | — |

## Workarounds

1. **Check the resource ID by decoding it using 'adb shell dumpsys package <package> | grep resource' and ensure the resource exists in the APK by inspecting the R.txt file in the build/outputs folder.** (85% success)
   ```
   Check the resource ID by decoding it using 'adb shell dumpsys package <package> | grep resource' and ensure the resource exists in the APK by inspecting the R.txt file in the build/outputs folder.
   ```
2. **Add missing resource to all required configuration folders (e.g., drawable, drawable-land, drawable-night) or use a programmatic fallback: 'if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { getDrawable(R.drawable.my_drawable, theme) } else { getResources().getDrawable(R.drawable.my_drawable) }'** (95% success)
   ```
   Add missing resource to all required configuration folders (e.g., drawable, drawable-land, drawable-night) or use a programmatic fallback: 'if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { getDrawable(R.drawable.my_drawable, theme) } else { getResources().getDrawable(R.drawable.my_drawable) }'
   ```

## Dead Ends

- **** — If the resource is missing from the APK due to a build configuration issue (e.g., missing drawable variant), a rebuild alone won't fix it. (50% fail)
- **** — If the device uses a specific configuration (e.g., landscape), the resource might still be missing; the resource must be present in all relevant qualifier folders or use a fallback. (50% fail)
