Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Proposal] Update default gradle version of the flutter template #102141

Closed
fmardini opened this issue Apr 19, 2022 · 5 comments
Closed

[Proposal] Update default gradle version of the flutter template #102141

fmardini opened this issue Apr 19, 2022 · 5 comments
Assignees
Labels
c: proposal A detailed proposal for a change to Flutter P3 Issues that are less important to the Flutter project platform-android Android applications specifically r: fixed Issue is closed as already fixed in a newer version t: gradle "flutter build" and "flutter run" on Android tool Affects the "flutter" command-line tool. See also t: labels.

Comments

@fmardini
Copy link

Some plugins are failing to build with the android build tools (gradle plugin) and gradle wrapper versions generated by the flutter templates (plugin/app)

For example see here googlesamples/mlkit#477

Upgrading the versions used the templates would resolve the issue

Many thanks

@maheshmnj maheshmnj added the in triage Presently being triaged by the triage team label Apr 20, 2022
@maheshmnj
Copy link
Member

Hi @fmardini, Thanks for filing the issue. I can see that using

implementation 'com.google.mlkit:pose-detection-accurate:18.0.0-beta2'

the build fails

mahesh@Maheshs-MacBook-Air-M1 example % flutter run
Launching lib/main.dart on Redmi K20 Pro in debug mode...
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > Android resource linking failed
     /Users/mahesh/Desktop/mlkit_pose/example/build/app/intermediates/packaged_manifests/debug/AndroidManifest.xml:70: AAPT: error: unexpected element <uses-native-library> found in <manifest><application>.

     /Users/mahesh/Desktop/mlkit_pose/example/build/app/intermediates/packaged_manifests/debug/AndroidManifest.xml:73: AAPT: error: unexpected element <uses-native-library> found in <manifest><application>.

     /Users/mahesh/Desktop/mlkit_pose/example/build/app/intermediates/packaged_manifests/debug/AndroidManifest.xml:76: AAPT: error: unexpected element <uses-native-library> found in <manifest><application>.


* 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 10s
Running Gradle task 'assembleDebug'...                             11.6s
Exception: Gradle task assembleDebug failed with exit code 1

However, I am not sure if increasing the default build.gradle version would be right. Labeling this issue as a proposal for the team to decide.

Here's a minimal sample project as per the reproducible steps

mlkit_pose.zip

flutter doctor -v (mac)
[✓] Flutter (Channel stable, 2.10.5, on macOS 12.3 21E230 darwin-arm, locale en-IN)
    • Flutter version 2.10.5 at /Users/mahesh/Documents/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 5464c5bac7 (12 hours ago), 2022-04-18 09:55:37 -0700
    • Engine revision 57d3bac3dd
    • Dart version 2.16.2
    • DevTools version 2.9.2

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/mahesh/Library/Android/sdk
    • Platform android-32, build-tools 31.0.0
    • ANDROID_HOME = /Users/mahesh/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.10.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.1)
    • 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.11+0-b60-7772763)

[✓] IntelliJ IDEA Community Edition (version 2021.2.1)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 61.2.4
    • Dart plugin version 212.5080.8

[✓] VS Code (version 1.65.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.39.20220405

[✓] Connected device (4 available)
    • Redmi K20 Pro (mobile) • 192.168.1.2:55555                    • android-arm64  • Android 11 (API 30)
    • iPhone 12 Pro (mobile) • 535317A4-921C-488F-B234-C2CC6D4AE5A1 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-5 (simulator)
    • macOS (desktop)        • macos                                • darwin-arm64   • macOS 12.3 21E230 darwin-arm
    • Chrome (web)           • chrome                               • web-javascript • Google Chrome 100.0.4896.88

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

@maheshmnj maheshmnj changed the title Gradle Build Tool Default Version [Proposal] Update default gradle version of the flutter template Apr 20, 2022
@maheshmnj maheshmnj added p: framework c: proposal A detailed proposal for a change to Flutter platform-android Android applications specifically t: gradle "flutter build" and "flutter run" on Android and removed in triage Presently being triaged by the triage team labels Apr 20, 2022
@fmardini
Copy link
Author

Thank you! It's worth noting that with the currently used versions, adding any plugin that uses will cause above build failures.

@stuartmorgan stuartmorgan added the tool Affects the "flutter" command-line tool. See also t: labels. label Jul 20, 2022
@GaryQian
Copy link
Contributor

I am upgrading gradle versions in templates in #108355

@GaryQian GaryQian self-assigned this Jul 26, 2022
@GaryQian GaryQian added the P3 Issues that are less important to the Flutter project label Jul 26, 2022
@GaryQian
Copy link
Contributor

GaryQian commented Aug 9, 2022

This was completed in #108355

@GaryQian GaryQian closed this as completed Aug 9, 2022
@maheshmnj maheshmnj added the r: fixed Issue is closed as already fixed in a newer version label Aug 9, 2022
@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: proposal A detailed proposal for a change to Flutter P3 Issues that are less important to the Flutter project platform-android Android applications specifically r: fixed Issue is closed as already fixed in a newer version t: gradle "flutter build" and "flutter run" on Android tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

No branches or pull requests

4 participants