You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Re-lands flutter/flutter#136880, fixesflutter/flutter#136879.
Additions to/things that are different from the original PR:
- Adds an entry to `gradle_errors.dart` that tells people when they run into the R8 bug because of using AGP 7.3.0 (https://issuetracker.google.com/issues/242308990).
- Previous PR moved templates off of AGP 7.3.0.
- Packages repo has been moved off AGP 7.3.0 (#7432).
Also, unrelatedly:
- Deletes an entry in `gradle_errors.dart` that informed people to build with `--no-shrink`. This flag [doesn't do anything](flutter/website#11022 (comment)), so it can't be the solution to any error.
- Uniquely lowers the priority of the `incompatibleKotlinVersionHandler`. This is necessary because the ordering of the errors doesn't fully determine the priority of which handler we decide to use, but also the order of the log lines. The kotlin error lines often print before the other error lines, so putting it last in the list of handlers isn't sufficient to lower it to be the lowest priority handler.
@@ -652,10 +642,7 @@ final GradleHandledError incompatibleCompileSdk35AndAgpVersionHandler = GradleHa
652
642
}) async {
653
643
globals.printBox(
654
644
'${globals.logger.terminal.warningMark} Using compileSdk 35 requires Android Gradle Plugin (AGP) 8.1.0 or higher.'
655
-
' \n Please upgrade to a newer AGP version. The version of AGP that your project uses is likely'
656
-
" defined in:\n${project.android.settingsGradleFile.path},\nin the 'plugins' closure. \n Alternatively, if your "
657
-
'project was created with an older version of the templates, it is likely \nin the buildscript.dependencies '
658
-
'closure of the top-level build.gradle:\n${project.android.hostAppGradleFile.path}.\n\n Finally, if you have a'
645
+
' \n Please upgrade to a newer AGP version.${_getAgpLocation(project)}\n\n Finally, if you have a'
659
646
' strong reason to avoid upgrading AGP, you can temporarily lower the compileSdk version in the following file:\n${project.android.appGradleFile.path}',
660
647
title: _boxTitle,
661
648
);
@@ -664,3 +651,24 @@ final GradleHandledError incompatibleCompileSdk35AndAgpVersionHandler = GradleHa
${globals.logger.terminal.warningMark} Version 7.3 of the Android Gradle Plugin (AGP) uses a version of R8 that contains a bug which causes this error (see more info at https://issuetracker.google.com/issues/242308990).
665
+
To fix this error, update to a newer version of AGP (at least 7.4.0).
Copy file name to clipboardExpand all lines: packages/flutter_tools/test/general.shard/android/gradle_errors_test.dart
+39-3Lines changed: 39 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -38,11 +38,10 @@ void main() {
38
38
networkErrorHandler,
39
39
permissionDeniedErrorHandler,
40
40
flavorUndefinedHandler,
41
-
r8FailureHandler,
41
+
r8DexingBugInAgp73Handler,
42
42
minSdkVersionHandler,
43
43
transformInputIssueHandler,
44
44
lockFileDepMissingHandler,
45
-
incompatibleKotlinVersionHandler,
46
45
minCompileSdkVersionHandler,
47
46
jvm11RequiredHandler,
48
47
outdatedGradleHandler,
@@ -52,6 +51,7 @@ void main() {
52
51
remoteTerminatedHandshakeHandler,
53
52
couldNotOpenCacheDirectoryHandler,
54
53
incompatibleCompileSdk35AndAgpVersionHandler,
54
+
incompatibleKotlinVersionHandler,
55
55
])
56
56
);
57
57
});
@@ -1320,7 +1320,6 @@ Execution failed for task ':app:bundleReleaseResources'.
1320
1320
'│ /android/settings.gradle, │\n'
1321
1321
"│ in the 'plugins' closure. │\n"
1322
1322
'│ Alternatively, if your project was created with an older version of the templates, it is likely │\n'
1323
-
'│ │\n'
1324
1323
'│ in the buildscript.dependencies closure of the top-level build.gradle: │\n'
1325
1324
'│ /android/build.gradle. │\n'
1326
1325
'│ │\n'
@@ -1337,6 +1336,43 @@ Execution failed for task ':app:bundleReleaseResources'.
1337
1336
FileSystem: () => fileSystem,
1338
1337
ProcessManager: () => processManager,
1339
1338
});
1339
+
1340
+
testUsingContext('AGP 7.3.0 R8 bug', () async {
1341
+
constString errorExample =r'''
1342
+
ERROR:/Users/mackall/.gradle/caches/transforms-3/bd2c84591857c6d4c308221ffece862e/transformed/jetified-media3-exoplayer-dash-1.4.0-runtime.jar: R8: com.android.tools.r8.internal.Y10: Unused argument with users in androidx
0 commit comments