Repository navigation
Closed
Labels
a: buildBuilding flutter applications with the toolBuilding flutter applications with the toolc: crashStack traces logged to the consoleStack traces logged to the consoleplatform-androidAndroid applications specificallyAndroid applications specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versiont: gradle"flutter build" and "flutter run" on Android"flutter build" and "flutter run" on Androidteam-androidOwned by Android platform teamOwned by Android platform teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Description
Steps to reproduce
- Upgraded Android Studio to 2024.1.1, upgraded SDK/tools
- Upgraded Flutter to 3.24.0
- Created a new Flutter project with
flutter create -t app test - Attempt to build apk:
flutter build apk
Actual results
Fails to apply the flutter gradle plugin (see logs). I'm able to get it to build by manually upgrading the Gradle and Kotlin version, then changing gradle distribution URL. I'm not sure why I have to do all of these things in the first place though for an empty project.
Logs
Logs
$ flutter build apk
FAILURE: Build failed with an exception.
* Where:
Build file '<redacted>/test/android/app/build.gradle' line: 5
* What went wrong:
An exception occurred applying plugin request [id: 'dev.flutter.flutter-gradle-plugin']
> Failed to apply plugin 'dev.flutter.flutter-gradle-plugin'.
> Could not get unknown property 'usesUnsupportedDependencyVersions' for project ':app' of type org.gradle.api.Project.
* 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 539ms
Running Gradle task 'assembleRelease'... 978ms
Gradle task assembleRelease failed with exit code 1
Flutter Doctor output
Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.24.0, on Ubuntu 22.04.4 LTS 6.8.0-40-generic, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Linux toolchain - develop for Linux desktop
[✓] Android Studio (version 2024.1)
[✓] VS Code (version 1.92.2)
[✓] Connected device (1 available)
[✓] Network resources
! Doctor found issues in 1 category.
Reacted by mocki-toki, Dmitriy, scuderia-notch, Richard, Ester Uscanga, Satya, Vasilis and Luca Di Fazio
Metadata
Metadata
Assignees
Labels
a: buildBuilding flutter applications with the toolBuilding flutter applications with the toolc: crashStack traces logged to the consoleStack traces logged to the consoleplatform-androidAndroid applications specificallyAndroid applications specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versiont: gradle"flutter build" and "flutter run" on Android"flutter build" and "flutter run" on Androidteam-androidOwned by Android platform teamOwned by Android platform teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Activity
mqhamdam commentedon Aug 19, 2024
Can not reproduce your issue.
did u try to delete android folder and run
AbdeMohlbi commentedon Aug 19, 2024
It would be easier if u provided ur gradle files
danagbemava-nc commentedon Aug 19, 2024
Hi @jefflongo, please provide the full output of
flutter build apk -v. The output may be huge so kindly put it into a .log/.txt file and attach it here. Please also provide yourandroid/build.gradle&android/app/build.gradlefiles.If you can also provide your gradle-wrapper.properties, that would help
Thank you
jefflongo commentedon Aug 19, 2024
Tried this, did not solve the problem.
I can do this, only reason I didn't is because I have not modified anything after creating the project. My expectation is that I should be able to build with whatever Flutter generates by default.
Here is some more information to debug with:
Log of
flutter build apk: log.txtbuild.gradle:
app/build.gradle
gradle-wrapper.properties:
xakoy commentedon Aug 21, 2024
same question.
xakoy commentedon Aug 21, 2024
I try do that remove gradle cache. rebuild, tip kotlin gradle plugin version:
update version laster
2.0.10insettings.gradlerebuild. It' successed. but has warning:
jefflongo commentedon Aug 21, 2024
@xakoy You can get it to compile without warnings by upgrading both the Kotlin version and Gradle version in
app/build.gradle, and changing the distribution URL to point to the new Gradle version ingradle-wrapper.properties. But on the topic of this issue, I don't see why we should have to make such modifications for a new generated project.danagbemava-nc commentedon Aug 21, 2024
Hi @jefflongo, I just tried building an apk after creating a new app with the latest stable version and it works as expected.
What version did you upgrade to? I'm currently using android studio 2024.1.1 Patch 2 with Android build tools 35
ckumaradev commentedon Aug 21, 2024
Hi,
I have the same issue with when I am doing release build, let me brief my findings
Flutter version: 3.24.0
In this version when I tried to do a release build through VS code or android studio terminal by running “flutter run — release ” , then I am getting this error at the verifyLibResorce task and it says also 44 plugins not complile with 34 sdk.
My project min sdk is 24 and max is 34.
But when I do debug build or when I open android folder in android studio and then try to generate signed bundle then it builds successfully 😳😳
But if I clean the build folder and then try to rebuild the project then again show this error
But if I change build varient to release and then try to re build then it is working
seems to my problem with this flutter run — release terminal command only
To check this then I have downloaded the Flutter 3.22.0 sdk version and did same steps and it worked without any problems even I can build using flutter run —release command also
So I think this is the issue with this sdk version
Thanks
jefflongo commentedon Aug 21, 2024
I'm using 2024.1.1 Patch 2. Build tools version is unspecified in the build.gradle (default should be defined by specification of
targetSdk) but if I manually set it to 35.0.0 it changes nothing.28 remaining items
JiyadAhammad commentedon Aug 31, 2024
Any solution for this
facing same issue
can't take release build in 3.24.1
[ ] FAILURE: Build failed with an exception.
[ ] * What went wrong:
[ ] Execution failed for task ':contacts_service:verifyReleaseResources'.
[ ] > A failure occurred while executing com.android.build.gradle.tasks.VerifyLibraryResourcesTask$Action
[ ] > Android resource linking failed
[ ]
ERROR:/Users/oonzoo1/Desktop/OONZOO/ginni/build/contacts_service/intermediates/merged_res/release/values/values.x
ml:194: AAPT: error: resource android:attr/lStar not found.
khjde1207 commentedon Aug 31, 2024
android/build.gradle
Richard-Van-Intania commentedon Sep 1, 2024
this work for me
just init firebase again and do nothing in ios android folder
Make sure `usesUnsupportedDependencyVersions` property exists before …
jefflongo commentedon Sep 4, 2024
Closing this issue now that Flutter 3.24.2 has landed and resolves this issue.
vishnuagbly commentedon Sep 11, 2024
I am still having the above issue in 3.24.2.
I resolved it by adding:
in
android/build.gradlegmackall commentedon Sep 11, 2024
Can you provide logs? Are you sure you are referring to this issue and not #153281 (comment)?
vishnuagbly commentedon Sep 12, 2024
ckumaradev commentedon Sep 12, 2024
Hi,
We are still facing this issue in 3.24.2 stable release also and I have tried by adding subprojects config mentioned above but still issue is there
Even I have added android.suppressUnsupportedCompileSdk=33,34 but issue still same
we need immediate solution for this because this is the only thing preventing us to update Flutter to this version
Thanks
gmackall commentedon Sep 12, 2024
Are you specifically encountering the error:
on
3.24.2? If so, can you provide additional logs, including the output offlutter doctor -v?A minimal reproduction would also be appreciated, if possible.
zzmps0901 commentedon Sep 26, 2024
Same issue here. I recently updated to Flutter SDK 3.24.3 and got this error run flutter build apk:
ERROR: /build/amap_flutter_location/intermediates/merged_res/release/values/values.xml:194: AAPT: error: resource android:attr/lStar not found
It seems like the amap_flutter_location plugin hasn't been updated for a long time. However, I found this solution that worked for me. Thanks.
github-actions commentedon Oct 10, 2024
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.