Skip to content

[flutter_tools] Support for Android Gradle Plugin 7.0.0 #87649

Closed

Description

@TahaTesser

As Android Gradle Plugin 7.0.0 released

Steps to reproduce

  1. Execute flutter create myapp
  2. Locate myapp/android and delete gradle distribution folder
  3. Update Android Gradle Plugin myapp/android/build.gradle to 7.0.0
  4. Execute flutter run -v from the root directory of myapp.

Actual Results:

Flutter doesn't support this version and throws the following exception: (using 7.0.2 default version)

[  +33 ms] Building APK
[  +40 ms] Running Gradle task 'assembleDebug'...
[  +15 ms] LocalFile: 'C:\Users\Taha\StudioProjects\triage-companion\android\build.gradle' provides AGP version: 7.0.0
[+9740 ms] Exception: Unsupported Android Plugin version: 7.0.0.
[   +2 ms] "flutter run" took 17,921ms.

The Source of this exception is here

Expected Results:

The app runs with updated AGP and Gradle distribution is downloaded

Activity

  1. maheshj01 commented on Aug 5, 2021

    @maheshj01
    Member

    I am able to reproduce it in on the latest master channel

    image

    flutter doctor -v
    [✓] Flutter (Channel master, 2.5.0-2.0.pre.69, on macOS 11.4 20F71 darwin-arm, locale en-GB)
        • Flutter version 2.5.0-2.0.pre.69 at /Users/mahesh/Documents/flutter_master
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision ccf6f0353a (10 minutes ago), 2021-07-29 01:50:54 -0700
        • Engine revision 40451453ab
        • Dart version 2.14.0 (build 2.14.0-361.0.dev)
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
        • Android SDK at /Users/mahesh/Library/Android/sdk
        • Platform android-30, build-tools 30.0.3
        • ANDROID_HOME = /Users/mahesh/Library/Android/sdk
        • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Xcode 12.4, Build version 12D4e
        • CocoaPods version 1.10.1
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 4.2)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
    
    [✓] IntelliJ IDEA Community Edition (version 2021.1.2)
        • IntelliJ at /Applications/IntelliJ IDEA CE.app
        • Flutter plugin version 57.0.5
        • Dart plugin version 211.7233
    
    [✓] VS Code (version 1.58.0)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.24.0
    
    [✓] Connected device (4 available)
        • sdk gphone arm64 (mobile)  • emulator-5554                        • android-arm64  • Android 11 (API 30) (emulator)
        • iPhone 12 Pro Max (mobile) • 6A434744-B348-4FB3-AB10-131292174456 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-4
          (simulator)
        • macOS (desktop)            • macos                                • darwin-arm64   • macOS 11.4 20F71 darwin-arm
        • Chrome (web)               • chrome                               • web-javascript • Google Chrome 92.0.4515.107
    
    • No issues found!
    
  2. added
    t: gradle"flutter build" and "flutter run" on Android
    toolAffects the "flutter" command-line tool. See also t: labels.
    c: proposalA detailed proposal for a change to Flutter
    platform-androidAndroid applications specifically
    and removed
    in triagePresently being triaged by the triage team
    on Aug 5, 2021
  3. self-assigned this
    on Aug 5, 2021
  4. TahaTesser commented on Aug 5, 2021

    @TahaTesser
    ContributorAuthor

    Assigned myself to this issue, I will work on a PR based on #71446

  5. stuartmorgan-g commented on Aug 5, 2021

    @stuartmorgan-g
    Contributor
  6. TahaTesser commented on Aug 5, 2021

    @TahaTesser
    ContributorAuthor

    I have modified the SDK locally and I am able to build, I will work on the PR tonight :)

  7. benedicte69 commented on Aug 31, 2021

    @benedicte69

    @TahaTesser, thank you for your answer. I was saying 'Linux minded' because one day I was growling about this subject (Gradle) and Tim interfered saying that the team was working on upgrading the Gradle, I could even see the code the team was working on. It was Linux and the Gradle was failing while the same Gradle on my Windows PC was not failing. I politely answer that 'it sounded complicated' (indeed I know nothing about Linux) thinking well let's wait it works on Linux.

    What would be great is that Gradle is updated more than once a year to fit at least the Android Studio minimum requirement which is at that moment::
    distributions/gradle-7.0.2(Release May 14, 2021) build:gradle:7.0.1, kotlin-gradle-plugin:1.5.30 minSdk 21;

    hoping, of course, it would not disturb Linux users and if it is the case that a solution is found not penalizing OS that can work with updated Gradle.

    Anyway, Android Studio is a nice tool to handle Gradle but spending 5 minutes at each project opened updating some flutter files is 'tiresome'

  8. benedicte69 commented on Aug 31, 2021

    @benedicte69

    @TahaTesser I will have tried here

    Anyway, thank you @TahaTesser for your great listening

  9. 38 remaining items

  10. TheFabbiusCorp commented on Dec 27, 2021

    @TheFabbiusCorp

    Same issue here with 7.0.4.

    However, if I specify to --split-per-abi, when building APKs, then it works fine.

  11. andrijailic commented on Jan 7, 2022

    @andrijailic

    Any news on this? I see that #90642 was merged but it seems like it was reverted as well?
    @TahaTesser

  12. rayliverified commented on Jan 11, 2022

    @rayliverified

    I'm seeing this issue appear again as well.

    flutter build apk --release

    Building with sound null safety

    Running Gradle task 'assembleRelease'... 30.9s
    Unsupported Android Plugin version: 7.0.3.

  13. added a commit that references this issue on Jan 12, 2022
  14. alexei-g-aloteq commented on Feb 23, 2022

    @alexei-g-aloteq

    Workaround for Android Studio:

    1. go to "Edit configurations"
    2. choose the config you're trying to run
    3. fill in the "Build flavor" accordingly

    It's enough just to set empty flavor:

    productFlavors {
    dev {
    dimension ""
    }
    }

    And refer to them ("dev").

    Found here: https://stackoverflow.com/questions/66558805/exception-unsupported-android-plugin-version-4-1-2

  15. LostInDarkMath commented on Mar 27, 2022

    @LostInDarkMath

    I have the same problem as @giorgio79:

    Could not create task ':flutter_plugin_android_lifecycle:generateDebugUnitTestConfig'.
    this and base files have different roots: E:\Projekte\Foo\foo-gitlab\source\frontend\build\flutter_plugin_android_lifecycle and C:\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_plugin_android_lifecycle-2.0.5\android.
    

    So my Gradle sync fails. Any ideas how to fix this?

  16. blasten commented on Mar 31, 2022

    @blasten

    Fixed by #99723

  17. added
    r: fixedIssue is closed as already fixed in a newer version
    on Mar 31, 2022
  18. github-actions commented on Apr 14, 2022

    @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.

  19. locked as resolved and limited conversation to collaborators on Apr 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

c: proposalA detailed proposal for a change to Flutterplatform-androidAndroid applications specificallyr: fixedIssue is closed as already fixed in a newer versiont: gradle"flutter build" and "flutter run" on AndroidtoolAffects 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