android.content.res.Resources$NotFoundException: Resource ID #0x7f...
Code asked for a resource ID that doesn’t exist for the current configuration — often passing an int to setText(), or a resource only in a qualified folder.
Seen on:
Android
Meaning
textView.setText(count) treats the int as a string resource ID. Drawables only in drawable-v24/-night, or resources stripped by shrinking (shrinkResources), also cause it.
Common causes
- Passing an Int to setText() instead of a String
- Resource only in a qualified folder (v24, night, sw600dp)
- Resource removed by resource shrinking
- Dynamic getIdentifier lookups
⚡ Quick fix
- Use setText(count.toString())
- Provide a default resource in the unqualified folder
- Keep dynamically referenced resources (tools:keep)
Detailed fix by platform
Kotlin
binding.counter.text = count.toString() // not setText(count)
How to diagnose
- ID — Which resource (aapt dump)?
- Call — setText(Int)?
- Configuration — Qualifiers
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Most viewed in Android
Other ways to find it
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 7 Oct 2026