-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listfound in release: 2.5Found to occur in 2.5Found to occur in 2.5has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-androidAndroid applications specificallyAndroid applications specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versiont: gradle"flutter build" and "flutter run" on Android"flutter build" and "flutter run" on AndroidtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Description
Flutter hardcodes supported Android Gradle Plugin versions in relation to Gradle version. The problem is, it's outdated.
We cannot use AGP 4.2.1, 4.2.2, 4.2.*, and 7.0.* (and possibly future ones).
This problem shows up when we try to build an app bundle:
Running Gradle task 'bundleXxxxxProdRelease'... 149.5s
Unsupported Android Plugin version: 4.2.2.
Those are the supported AGP <=> Gradle versions: https://developer.android.com/studio/releases/gradle-plugin#updating-gradle
flutter/packages/flutter_tools/lib/src/android/gradle_utils.dart
Lines 148 to 186 in cf885c1
| String getGradleVersionFor(String androidPluginVersion) { | |
| if (_isWithinVersionRange(androidPluginVersion, min: '1.0.0', max: '1.1.3')) { | |
| return '2.3'; | |
| } | |
| if (_isWithinVersionRange(androidPluginVersion, min: '1.2.0', max: '1.3.1')) { | |
| return '2.9'; | |
| } | |
| if (_isWithinVersionRange(androidPluginVersion, min: '1.5.0', max: '1.5.0')) { | |
| return '2.2.1'; | |
| } | |
| if (_isWithinVersionRange(androidPluginVersion, min: '2.0.0', max: '2.1.2')) { | |
| return '2.13'; | |
| } | |
| if (_isWithinVersionRange(androidPluginVersion, min: '2.1.3', max: '2.2.3')) { | |
| return '2.14.1'; | |
| } | |
| if (_isWithinVersionRange(androidPluginVersion, min: '2.3.0', max: '2.9.9')) { | |
| return '3.3'; | |
| } | |
| if (_isWithinVersionRange(androidPluginVersion, min: '3.0.0', max: '3.0.9')) { | |
| return '4.1'; | |
| } | |
| if (_isWithinVersionRange(androidPluginVersion, min: '3.1.0', max: '3.1.9')) { | |
| return '4.4'; | |
| } | |
| if (_isWithinVersionRange(androidPluginVersion, min: '3.2.0', max: '3.2.1')) { | |
| return '4.6'; | |
| } | |
| if (_isWithinVersionRange(androidPluginVersion, min: '3.3.0', max: '3.3.2')) { | |
| return '4.10.2'; | |
| } | |
| if (_isWithinVersionRange(androidPluginVersion, min: '3.4.0', max: '3.5.0')) { | |
| return '5.6.2'; | |
| } | |
| if (_isWithinVersionRange(androidPluginVersion, min: '4.0.0', max: '4.1.0')) { | |
| return '6.7'; | |
| } | |
| throwToolExit('Unsupported Android Plugin version: $androidPluginVersion.'); | |
| } |
Flutter 2.5.1 • channel unknown • unknown source
Framework • revision ffb2ecea52 (5 weeks ago) • 2021-09-17 15:26:33 -0400
Engine • revision b3af521a05
Tools • Dart 2.14.2
bartekpacia, mateuszwojtczak, mariazebrowska, mkucharski17, szakes1 and 8 more
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listfound in release: 2.5Found to occur in 2.5Found to occur in 2.5has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-androidAndroid applications specificallyAndroid applications specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versiont: gradle"flutter build" and "flutter run" on Android"flutter build" and "flutter run" on AndroidtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.