Skip to content

Upgrade the Gradle version in the project template #49438

Description

@blasten

Gradle 6.0 came out recently: https://docs.gradle.org/6.0/release-notes.html

The Flutter template currently uses 5.6. However, 6.0 might become the default version for new Android apps generated by Android Studio.

For context, this is already the case: #46260 (comment) if a Flutter app is edited on Android Studio.

Activity

  1. added
    c: new featureNothing broken; request for a new capability
    toolAffects the "flutter" command-line tool. See also t: labels.
    t: gradle"flutter build" and "flutter run" on Android
    on Jan 24, 2020
  2. jmagman commented on Feb 27, 2020

    @jmagman
    Member

    From #51464:

    Android Studio 3.6 was released recently, and it seems it now requires a higher version of Gradle than the one Flutter is using.

    Steps to Reproduce

    1. Run flutter create bug.
    2. Update the files as follows: android/build.gradle -> classpath 'com.android.tools.build:gradle:3.6.0'
    3. Try to run or build the app for Android.
    4. The exception provided in the Logs section will appear.

    Flutter projects are currently created using Gradle version 5.4.1, but to make it compatible with newer versions of Android Studio, it could be bumped to, at least, 5.6.4, or even 6.2.1 (latest).

  3. self-assigned this
    on Feb 27, 2020
  4. added this to the March 2020 milestone on Feb 27, 2020
  5. modified the milestones: March 2020, on Apr 7, 2020
  6. modified the milestones: , July 2020 on Apr 7, 2020
  7. added
    P1High-priority issues at the top of the work list
    on May 29, 2020
  8. removed this from the 1.21 - July 2020 milestone on Jul 8, 2020
  9. renanyoy commented on Nov 5, 2020

    @renanyoy

    trying to build our app from vscode
    it was working before
    seems related to flutter using an obsolete gradle version

    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':app:processDebugResources'.
    > Android resource linking failed
      /Users/renanyoy/git/a2ds/apps/Flutter/leads2keys/build/app/intermediates/merged_manifests/debug/AndroidManifest.xml:22: AAPT: error: unexpected element <queries> found in <manifest>.
    
    [✓] Flutter (Channel stable, 1.22.3, on Mac OS X 10.15.7 19H2, locale en-FR)
        • Flutter version 1.22.3 at /Users/renanyoy/code/sdk/flutter
        • Framework revision 8874f21e79 (7 days ago), 2020-10-29 14:14:35 -0700
        • Engine revision a1440ca392
        • Dart version 2.10.3
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
        • Android SDK at /Users/renanyoy/Library/Android/sdk
        • Platform android-30, build-tools 30.0.2
        • Java binary at: /Applications/Android
          Studio.app/Contents/jre/jdk/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build
          1.8.0_242-release-1644-b3-6222593)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 12.1)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Xcode 12.1, Build version 12A7403
        • CocoaPods version 1.10.0.rc.1
    
    [✓] Android Studio (version 4.0)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin version 50.0.1
        • Dart plugin version 193.7547
        • Java version OpenJDK Runtime Environment (build
          1.8.0_242-release-1644-b3-6222593)
    
    [✓] VS Code (version 1.50.1)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.16.0
    
     
    [✓] Connected device (2 available)            
        • Pixel 3a (mobile)    • 9BCAY1J68Q                • android-arm64 • Android 11 (API 30)
        • Renaniphone (mobile) • 00008020-000640992209002E • ios           • iOS 14.1
    
  10. renanyoy commented on Nov 10, 2020

    @renanyoy

    fixed with gradle update to 6.7.0 and reverting back build.graddle from 4.0.1 to 3.6.2

    dependencies {
            classpath 'com.android.tools.build:gradle:3.6.2'
    
  11. jmagman commented on Nov 24, 2020

    @jmagman
    Member

    #70808 was reverted.

  12. github-actions commented on Aug 9, 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.

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

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work listc: new featureNothing broken; request for a new capabilityt: 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