Skip to content

Cannot build apk from new project after upgrade #153668

@jefflongo

Description

@jefflongo

Steps to reproduce

  1. Upgraded Android Studio to 2024.1.1, upgraded SDK/tools
  2. Upgraded Flutter to 3.24.0
  3. Created a new Flutter project with flutter create -t app test
  4. 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.

Metadata

Metadata

Assignees

Labels

a: buildBuilding flutter applications with the toolc: crashStack traces logged to the consoleplatform-androidAndroid applications specificallyr: fixedIssue is closed as already fixed in a newer versiont: gradle"flutter build" and "flutter run" on Androidteam-androidOwned by Android platform teamtoolAffects the "flutter" command-line tool. See also t: labels.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions