AAPT: error: resource x (aka y) not found — Android resource linking failed
A layout, manifest or style references a resource (drawable, string, style, attribute) that doesn’t exist in the module or its dependencies.
Seen on:
Android
Meaning
Typos, resources deleted/renamed, a theme from a library you removed (Theme.AppCompat without appcompat, Material styles without material), or resources only in another flavor/module.
Common causes
- Referenced resource doesn’t exist (typo, deleted)
- Theme/style from a missing library
- Resource defined only in another flavor/source set
- Attribute requires a higher compileSdk
⚡ Quick fix
- Read the exact resource name and file in the error
- Add the missing dependency (appcompat/material) or fix the name
- Clean and rebuild after renames
Detailed fix by platform
Gradle
- kotlin
dependencies { implementation("com.google.android.material:material:1.12.0") }
How to diagnose
- Reference — Which file/line?
- Library — Provides that style/attr?
- Flavor — Defined for this variant?
🔧 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
- ActivityNotFoundException ActivityNotFoundException: Unable to find explicit activity class; have you declared this activity in your AndroidManifest.xml?
- android:attr/lStar not found AAPT: error: resource android:attr/lStar not found
- BadTokenException WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running?
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