Android resource linking failed Android Origin: On your device Last updated 13 Oct 2026

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.

Exact message you may see Android resource linking failedAAPT: error: resourcestyle attribute not found
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

  1. Read the exact resource name and file in the error
  2. Add the missing dependency (appcompat/material) or fix the name
  3. Clean and rebuild after renames

Detailed fix by platform

Gradle

  1. kotlin
    dependencies {
      implementation("com.google.android.material:material:1.12.0")
    }

How to diagnose

  1. Reference — Which file/line?
  2. Library — Provides that style/attr?
  3. 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:

Where this error sits

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

ActivityNotFoundException — ActivityNotFoundException: Unable to find explicit activity class; have you declared this activity in your AndroidManifest.xml? (Android)ActivityNotFoundExcep…android:attr/lStar not found — AAPT: error: resource android:attr/lStar not found (Android)android:attr/lStar no…BadTokenException — WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running? (Android)BadTokenExceptionCalledFromWrongThreadException — CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views (Android)CalledFromWrongThread…Can not perform this action after onSaveInstanceState — IllegalStateException: Can not perform this action after onSaveInstanceState (fragment transaction) (Android)Can not perform this …Cannot access database on the main thread — Room: Cannot access database on the main thread since it may potentially lock the UI for a long period of time (Android)Cannot access databas…Cannot fit requested classes in a single dex file — Cannot fit requested classes in a single dex file (# methods: 65536 > 65536) — mergeDex failed (Android)Cannot fit requested …Could not resolve — Gradle: Could not resolve all files for configuration / Could not resolve dependency (Android)Could not resolveAndroid r…

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.