Resources$NotFoundException Android Origin: On your device Last updated 12 Oct 2026

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.

Exact message you may see Resource ID #0xString resource ID #0x
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:

Where this error sits

Origin: On your device. Errors that are often confused with or caused by this one (click to open):

Android resource linking failed — AAPT: error: resource x (aka y) not found — Android resource linking failed (Android)Android resource link…android:attr/lStar not found — AAPT: error: resource android:attr/lStar not found (Android)android:attr/lStar no…Duplicate resources — Execution failed for task ':app:mergeDebugResources'. > Duplicate resources (Android)Duplicate resourcesEvicted — Kubernetes: Pod Evicted — The node was low on resource: memory / ephemeral-storage (Kubernetes)Evictedexceeded quota — Error creating: pods is forbidden: exceeded quota: compute-resources, requested: limits.memory=1Gi, used: ..., limited: ... (Kubernetes)exceeded quotamust specify limits — pods is forbidden: failed quota: must specify limits.cpu,limits.memory,requests.cpu,requests.memory (Kubernetes)must specify limitsResourceNotFound — ResourceNotFound: The Resource 'Microsoft.X/...' under resource group 'y' was not found (Azure)ResourceNotFoundResources…

Explore the map of this error Full error map →

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

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.