Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
beef8486
Unverified
Commit
beef8486
authored
Aug 15, 2022
by
Gary Qian
Committed by
GitHub
Aug 15, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update `flutter.gradle` AGP to 7.2.0 and bump default NDK version (#109211)
parent
3be3594d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
7 deletions
+13
-7
flutter.gradle
packages/flutter_tools/gradle/flutter.gradle
+12
-6
gradle_utils.dart
packages/flutter_tools/lib/src/android/gradle_utils.dart
+1
-1
No files found.
packages/flutter_tools/gradle/flutter.gradle
View file @
beef8486
...
@@ -40,9 +40,10 @@ class FlutterExtension {
...
@@ -40,9 +40,10 @@ class FlutterExtension {
/**
/**
* Sets the ndkVersion used by default in Flutter app projects.
* Sets the ndkVersion used by default in Flutter app projects.
* Chosen as default version of the AGP version below.
* Chosen as default version of the AGP version below as found in
* https://developer.android.com/studio/projects/install-ndk#default-ndk-per-agp
*/
*/
static
String
ndkVersion
=
"21.
1.6352462
"
static
String
ndkVersion
=
"21.
4.7075529
"
/**
/**
* Specifies the relative directory to the Flutter project directory.
* Specifies the relative directory to the Flutter project directory.
...
@@ -61,7 +62,7 @@ buildscript {
...
@@ -61,7 +62,7 @@ buildscript {
}
}
dependencies
{
dependencies
{
/* When bumping, also update ndkVersion above. */
/* When bumping, also update ndkVersion above. */
classpath
'com.android.tools.build:gradle:
4.1
.0'
classpath
'com.android.tools.build:gradle:
7.2
.0'
}
}
}
}
...
@@ -94,6 +95,8 @@ class FlutterPlugin implements Plugin<Project> {
...
@@ -94,6 +95,8 @@ class FlutterPlugin implements Plugin<Project> {
private
static
final
String
ARCH_X86
=
"x86"
;
private
static
final
String
ARCH_X86
=
"x86"
;
private
static
final
String
ARCH_X86_64
=
"x86_64"
;
private
static
final
String
ARCH_X86_64
=
"x86_64"
;
private
static
final
String
INTERMEDIATES_DIR
=
"intermediates"
;
/** Maps platforms to ABI architectures. */
/** Maps platforms to ABI architectures. */
private
static
final
Map
PLATFORM_ARCH_MAP
=
[
private
static
final
Map
PLATFORM_ARCH_MAP
=
[
(
PLATFORM_ARM32
)
:
ARCH_ARM32
,
(
PLATFORM_ARM32
)
:
ARCH_ARM32
,
...
@@ -743,6 +746,7 @@ class FlutterPlugin implements Plugin<Project> {
...
@@ -743,6 +746,7 @@ class FlutterPlugin implements Plugin<Project> {
return
target
return
target
}
}
// TODO: Remove this AGP hack. https://github.com/flutter/flutter/issues/109560
/**
/**
* In AGP 4.0, the Android linter task depends on the JAR tasks that generate `libapp.so`.
* In AGP 4.0, the Android linter task depends on the JAR tasks that generate `libapp.so`.
* When building APKs, this causes an issue where building release requires the debug JAR,
* When building APKs, this causes an issue where building release requires the debug JAR,
...
@@ -752,7 +756,9 @@ class FlutterPlugin implements Plugin<Project> {
...
@@ -752,7 +756,9 @@ class FlutterPlugin implements Plugin<Project> {
* from the command line.
* from the command line.
*
*
* The AGP team said that this issue is fixed in Gradle 7.0, which isn't released at the
* The AGP team said that this issue is fixed in Gradle 7.0, which isn't released at the
* time of adding this code. Once released, this can be removed.
* time of adding this code. Once released, this can be removed. However, after updating to
* AGP/Gradle 7.2.0/7.5, removing this hack still causes build failures. Futher
* investigation necessary to remove this.
*
*
* Tested cases:
* Tested cases:
* * `./gradlew assembleRelease`
* * `./gradlew assembleRelease`
...
@@ -893,7 +899,7 @@ class FlutterPlugin implements Plugin<Project> {
...
@@ -893,7 +899,7 @@ class FlutterPlugin implements Plugin<Project> {
trackWidgetCreation
trackWidgetCreationValue
trackWidgetCreation
trackWidgetCreationValue
targetPlatformValues
=
targetPlatforms
targetPlatformValues
=
targetPlatforms
sourceDir
getFlutterSourceDirectory
()
sourceDir
getFlutterSourceDirectory
()
intermediateDir
project
.
file
(
"${project.buildDir}/$
{AndroidProject.FD_INTERMEDIATES}
/flutter/${variant.name}/"
)
intermediateDir
project
.
file
(
"${project.buildDir}/$
INTERMEDIATES_DIR
/flutter/${variant.name}/"
)
extraFrontEndOptions
extraFrontEndOptionsValue
extraFrontEndOptions
extraFrontEndOptionsValue
extraGenSnapshotOptions
extraGenSnapshotOptionsValue
extraGenSnapshotOptions
extraGenSnapshotOptionsValue
splitDebugInfo
splitDebugInfoValue
splitDebugInfo
splitDebugInfoValue
...
@@ -915,7 +921,7 @@ class FlutterPlugin implements Plugin<Project> {
...
@@ -915,7 +921,7 @@ class FlutterPlugin implements Plugin<Project> {
}
}
}
}
}
}
File
libJar
=
project
.
file
(
"${project.buildDir}/$
{AndroidProject.FD_INTERMEDIATES}
/flutter/${variant.name}/libs.jar"
)
File
libJar
=
project
.
file
(
"${project.buildDir}/$
INTERMEDIATES_DIR
/flutter/${variant.name}/libs.jar"
)
Task
packFlutterAppAotTask
=
project
.
tasks
.
create
(
name:
"packLibs${FLUTTER_BUILD_PREFIX}${variant.name.capitalize()}"
,
type:
Jar
)
{
Task
packFlutterAppAotTask
=
project
.
tasks
.
create
(
name:
"packLibs${FLUTTER_BUILD_PREFIX}${variant.name.capitalize()}"
,
type:
Jar
)
{
destinationDir
libJar
.
parentFile
destinationDir
libJar
.
parentFile
archiveName
libJar
.
name
archiveName
libJar
.
name
...
...
packages/flutter_tools/lib/src/android/gradle_utils.dart
View file @
beef8486
...
@@ -41,7 +41,7 @@ const String templateKotlinGradlePluginVersion = '1.7.10';
...
@@ -41,7 +41,7 @@ const String templateKotlinGradlePluginVersion = '1.7.10';
const
String
compileSdkVersion
=
'31'
;
const
String
compileSdkVersion
=
'31'
;
const
String
minSdkVersion
=
'16'
;
const
String
minSdkVersion
=
'16'
;
const
String
targetSdkVersion
=
'31'
;
const
String
targetSdkVersion
=
'31'
;
const
String
ndkVersion
=
'21.
1.6352462
'
;
const
String
ndkVersion
=
'21.
4.7075529
'
;
final
RegExp
_androidPluginRegExp
=
RegExp
(
r'com\.android\.tools\.build:gradle:(\d+\.\d+\.\d+)'
);
final
RegExp
_androidPluginRegExp
=
RegExp
(
r'com\.android\.tools\.build:gradle:(\d+\.\d+\.\d+)'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment