Skip to content

Commit de35764

Browse files
authored
[Android] Bump template AGP and NDK versions (#116536)
* Bump versions * Fix gradle errors test
1 parent fdd2d7d commit de35764

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

packages/flutter_tools/gradle/flutter.gradle

+8-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ import org.gradle.api.tasks.bundling.Jar
2727
import org.gradle.internal.os.OperatingSystem
2828
import org.gradle.util.VersionNumber
2929

30-
/** For apps only. Provides the flutter extension used in app/build.gradle. */
30+
/** For apps only. Provides the flutter extension used in app/build.gradle.
31+
* The versions specified here should match the values used in
32+
* ../lib/src/android/gradle_utils.dart, so when bumping, make sure to update
33+
* the versions specified there.
34+
*/
3135
class FlutterExtension {
3236
/** Sets the compileSdkVersion used by default in Flutter app projects. */
3337
static int compileSdkVersion = 33
@@ -61,7 +65,9 @@ buildscript {
6165
mavenCentral()
6266
}
6367
dependencies {
64-
/* When bumping, also update ndkVersion above. */
68+
/** When bumping, also update ndkVersion above, as well as the Android Gradle Plugin
69+
* version in ../lib/src/android/gradle_utils.dart.
70+
*/
6571
classpath 'com.android.tools.build:gradle:7.3.0'
6672
}
6773
}

packages/flutter_tools/lib/src/android/gradle_utils.dart

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ import 'android_sdk.dart';
2828
// https://developer.android.com/studio/releases/gradle-plugin#updating-gradle
2929
// https://kotlinlang.org/docs/releases.html#release-details
3030
const String templateDefaultGradleVersion = '7.5';
31-
const String templateAndroidGradlePluginVersion = '7.2.0';
32-
const String templateDefaultGradleVersionForModule = '7.2.0';
31+
const String templateAndroidGradlePluginVersion = '7.3.0';
32+
const String templateDefaultGradleVersionForModule = '7.3.0';
3333
const String templateKotlinGradlePluginVersion = '1.7.10';
3434

3535
// These versions should match the values in flutter.gradle (FlutterExtension).
@@ -41,7 +41,7 @@ const String templateKotlinGradlePluginVersion = '1.7.10';
4141
const String compileSdkVersion = '31';
4242
const String minSdkVersion = '16';
4343
const String targetSdkVersion = '31';
44-
const String ndkVersion = '21.4.7075529';
44+
const String ndkVersion = '23.1.7779620';
4545

4646
final RegExp _androidPluginRegExp = RegExp(r'com\.android\.tools\.build:gradle:(\d+\.\d+\.\d+)');
4747

packages/flutter_tools/test/general.shard/android/gradle_errors_test.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,7 @@ A problem occurred evaluating project ':app'.
979979
'│ To fix this issue, replace the following content: │\n'
980980
'│ /android/build.gradle: │\n'
981981
"│ - classpath 'com.android.tools.build:gradle:<current-version>' │\n"
982-
"│ + classpath 'com.android.tools.build:gradle:7.2.0' │\n"
982+
"│ + classpath 'com.android.tools.build:gradle:7.3.0' │\n"
983983
'│ /android/gradle/wrapper/gradle-wrapper.properties: │\n'
984984
'│ - https://services.gradle.org/distributions/gradle-<current-version>-all.zip │\n'
985985
'│ + https://services.gradle.org/distributions/gradle-7.5-all.zip │\n'

0 commit comments

Comments
 (0)