Skip to content

Android Studio updated gradle version of my project and now flutter run fails #9842

Closed

Description

@goderbauer

I opened my Flutter project in Android Studio to edit some native Android code. Android Studio told me that I should immediately update the gradle version of my project because of important bug fixes (the messages sounded rather urgent). I foolishly clicked "upgrade gradle" and now my project doesn't build with flutter run anymore 😞

C:\src\firebase_messaging\example [master]> flutter run
Running 'flutter packages get' in example...          0.7s
Launching lib/main.dart on Nexus 6P in debug mode...
FAILURE: Build failed with an exception.

* Where:
Build file 'C:\src\firebase_messaging\example\android\app\build.gradle' line: 14

* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin [id 'com.android.application']
   > Minimum supported Gradle version is 3.3. Current version is 3.2. If using the gradle wrapper, try editing the distributionUrl in C:\src\firebase_messaging\example\android\gradle\wrapper\gradle-wrapper.properties to gradle-3.3-all.zip

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Error running gradle: Exit code 1 from: C:\Program Files\Android\Android Studio\gradle\gradle-3.2\bin\gradle.bat app:properties
Running 'gradle assembleDebug'...

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\src\firebase_messaging\example\android\app\build.gradle' line: 14

* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin [id 'com.android.application']
   > Minimum supported Gradle version is 3.3. Current version is 3.2. If using the gradle wrapper, try editing the distributionUrl in C:\src\firebase_messaging\example\android\gradle\wrapper\gradle-wrapper.properties to gradle-3.3-all.zip

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Gradle build failed: 1

Building and Running from Android Studio still works fine, but I miss that hot reload...

/cc @mit-mit @jakobr-google

Activity

  1. added a commit that references this issue on May 8, 2017
    0772aca
  2. added this to the milestone on May 10, 2017
  3. added
    t: gradle"flutter build" and "flutter run" on Android
    on May 10, 2017
  4. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    on May 23, 2017
  5. mit-mit commented on Jun 9, 2017

    @mit-mit
    Member

    While we are working on a real resolution to this problem, the following workaround seems to work:

    Install gradle 3.3:

    1. Download gradle-3.3 from https://services.gradle.org/distributions/gradle-3.2.1-bin.zip
    2. Unzip file to the gradle installation dir
      • MacOS: /Applications/Android Studio/Contents/gradle/
      • Windows: C:\Program Files\Android\Android Studio\gradle

    When opening in Android Studio, answer prompts like this:

    • 'Gradle sync... Would you like the project to use gradle wrapper': Answer Cancel
    • 'Gradle home: ..., Gradle location is unknown': Give path to gradle 3.3 from above
    • 'Android gradle plugin update recommended': Answer 'Don't remind me again for this project'
  6. self-assigned this
    on Jun 22, 2017
  7. mravn-google commented on Jun 26, 2017

    @mravn-google
    Contributor

    Closed via #10928.

  8. github-actions commented on Sep 4, 2021

    @github-actions

    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 -v and a minimal reproduction of the issue.

  9. locked as resolved and limited conversation to collaborators on Sep 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

t: gradle"flutter build" and "flutter run" on AndroidtoolAffects the "flutter" command-line tool. See also t: labels.

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions