AAPT: error: resource android:attr/lStar not found
A dependency (androidx.core 1.7+) uses an attribute from Android 12 (API 31), but your module compiles against an older compileSdk.
Seen on:
Android
Meaning
Usually a transitive dependency upgraded androidx.core. Raising compileSdk to 31+ fixes it; forcing an older androidx.core is a workaround.
Common causes
- compileSdk below 31 with androidx.core 1.7+
- Plugin/library module compiled with old compileSdk (Flutter/RN plugins)
⚡ Quick fix
- Set compileSdk 31+ in all modules
- Force compileSdk for subprojects in the root build file
- Pin androidx.core to an older version as a last resort
Detailed fix by platform
Gradle
- kotlin
subprojects { afterEvaluate { extensions.findByName("android")?.let { (it as com.android.build.gradle.BaseExtension).compileSdkVersion(34) } } }
How to diagnose
- compileSdk — Of the failing module
- Dependency — Which pulls androidx.core?
🔧 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 resource linking failed AAPT: error: resource x (aka y) not found — Android resource linking failed
- 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