Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APK build failure: AAPT: error: resource android:attr/lStar not found #9

Open
jpwoodbu opened this issue Jan 18, 2025 · 3 comments
Open

Comments

@jpwoodbu
Copy link
Contributor

Steps to reproduce:

  1. flutter create delme
  2. cd delme
  3. Ensure the demo app can build an APK without error. flutter build apk
  4. flutter pub add flutter_android_volume_keydown
  5. Rebuild APK to see error message. flutter build apk.
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':flutter_android_volume_keydown:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.tasks.VerifyLibraryResourcesTask$Action
   > Android resource linking failed
     ERROR: /home/jpwoodbu/devel/delme/build/flutter_android_volume_keydown/intermediates/merged_res/release/values/values.xml:194: AAPT: error: resource android:attr/lStar not found.


* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 43s
Running Gradle task 'assembleRelease'...                           43.7s
Gradle task assembleRelease failed with exit code 1
@jpwoodbu
Copy link
Contributor Author

I should add my env details.

$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.27.1, on Ubuntu 22.04.5 LTS 6.5.0-45-generic, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[✓] Chrome - develop for the web
[✓] Linux toolchain - develop for Linux desktop
[✓] Android Studio (version 2024.1)
[✓] VS Code (version 1.96.4)
[✓] Connected device (2 available)
[✓] Network resources

• No issues found!

This is with flutter_android_volume_keydown: ^1.0.1 in my pubspec.yaml.

Also of note, flutter build appbundle works fine.

@jgoyvaerts
Copy link
Contributor

Can't reproduce on Flutter 3.22.2 on Windows.

I'll try to trace it down on your version but I'll have to do that somewhere in a few days

@jpwoodbu
Copy link
Contributor Author

Thanks for taking a look.

I found https://stackoverflow.com/questions/69033022/message-error-resource-androidattr-lstar-not-found which lead me to experiment with editing ~/.pub-cache/hosted/pub.dev/flutter_android_volume_keydown-1.0.1/android/build.gradle to set compileSdkVersion to 34.

And that fixed it for me. However, I do not know if making that change upstream is safe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants