Resources$NotFoundException 🤖 Android

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

  1. Use setText(count.toString())
  2. Provide a default resource in the unqualified folder
  3. Keep dynamically referenced resources (tools:keep)

Detailed fix by platform

Kotlin

  1. binding.counter.text = count.toString() // not setText(count)

How to diagnose

  1. ID — Which resource (aapt dump)?
  2. Call — setText(Int)?
  3. 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:

🧠 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.