Android resource linking fails with resource android:attr/lStar not found
AAPT: error: resource android:attr/lStar not found.Short answer
The lStar attribute exists only from Android API 31. A library that uses it cannot link when the module compiling it targets an older compileSdk. Raise compileSdk in the module named in the error to 31 or higher, or update the plugin that sets the old value.
Fix it fast
1Find out which cause you have
Read the task name and the file path in the error. They name the module whose compileSdk is too low, usually a plugin and not your app.
flutter build apk --debug 2>&1 | grep -n -B2 -A4 'lStar'2Match what you see, then jump to its fix
What does the error look like?
AAPT: error: resource android:attr/lStar not found.error: failed linking references.Execution failed for task ':plugin_name:verifyReleaseResources'.
Cause 1 of 2
A plugin module compiles against an API level below 31
1Check
android:attr/lStar was added in API level 31. A module that compiles with a lower compileSdk does not know the attribute, so linking a library that uses it fails.
grep -rn 'compileSdk' $HOME/.pub-cache/hosted/pub.dev/some_plugin-*/android/build.gradle*2Fix
Update the plugin to a release that raised its compileSdk. If none exists, fork it or use a path dependency and raise the value in its android build file.
flutter pub upgrade some_plugin
# plugin android/build.gradle
android {
compileSdk = 36
}3Verify
The linking step passes.
flutter clean && flutter build apk --debugConfirmed by developer.android.com
Cause 2 of 2
The app module itself still has an old compileSdk
1Check
Library resources are linked against the compileSdk of the module they are built into. Check what your app uses.
grep -n 'compileSdk' android/app/build.gradle*2Fix
Set an explicit compileSdk of 31 or higher.
// android/app/build.gradle.kts
android {
compileSdk = 36
}3Verify
A clean debug build finishes.
flutter clean && flutter build apk --debugConfirmed by developer.android.com
How do I stop it coming back?
- Keep plugins current with flutter pub outdated before each release.
- Raise compileSdk in step with Flutter upgrades, not when a build breaks.
- Read the failing Gradle task name first; it tells you whose build file to change.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
- TaxiDexMy own multi-tenant taxi dispatch SaaS: API, dispatcher portal, driver and passenger apps, and the servers underneath.
- QistLockA NestJS and React SaaS driving an Android Device Owner agent that locks financed phones when payments lapse.
- Dispatch ProA real-time logistics platform: Flutter apps, Spring Boot services and a Kafka event pipeline on AWS.
Related fixes
Mobile apps
Flutter Android build stops with Execution failed for task ':app:…'
Execution failed for task ':app:compileFlutterBuildRelease'.
The line only tells you which Gradle step broke; the task name in the quotes tells you why.
5 causes, each with a fixMobile apps
Google Play says the app does not support 16 KB memory pages
check_elf_alignment.sh reports UNALIGNED for a library under lib/arm64-v8a
Google Play requires apps that target Android 15 or higher and ship native .so libraries to run on devices with 16 KB memory pages; from 1 February 2027 it will block updates that do not.
5 causes, each with a fixMobile apps
Gradle cannot find com.google.firebase:firebase-analytics-ktx
Required by: project :app
Firebase moved the Kotlin extensions into the main modules and stopped releasing the -ktx modules in July 2025.
2 causes, each with a fixMobile apps
Gradle cannot create LibraryVariantBuilderImpl in a Flutter Android build
Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl
This error appears when the Android Gradle plugin (AGP) cannot run in the Gradle or IDE you use.
3 causes, each with a fixMobile apps
Flutter release build cannot open the keystore: HmacPBESHA256 not available
Algorithm HmacPBESHA256 not available
The keystore is a PKCS12 file protected by a newer algorithm than the Java that is reading it understands.
3 causes, each with a fixMobile apps
Android install error: the package conflicts with an existing package of the same name
The package conflicts with an existing package by the same name
Android allows only one app per application ID, and an update must be signed with the same certificate as the installed version.
3 causes, each with a fix