Skip to content

Commit 54cf286

Browse files
authored
[Android] Update Java/AGP/Gradle warning compatible Java range (#135710)
Specifies that compatible Java range stated in warning when Java version is incompatible with our template AGP & Gradle versions notes an exclusive upper bound Java version. This was a bug from flutter/flutter#131444, and I will file a CP request to stable once this lands. The warning uses [`getJavaVersionFor`](https://github.com/flutter/flutter/blob/b5c8fd11e4906d900039584b4f67c9753327060c/packages/flutter_tools/lib/src/android/gradle_utils.dart#L606), which returns an exclusive upper bound, which is why this fix is necessary.
1 parent 640050b commit 54cf286

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/flutter_tools/lib/src/commands/create.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,7 @@ String getIncompatibleJavaGradleAgpMessageHeader(
968968
final String incompatibleDependencyVersion = javaGradleVersionsCompatible ? 'AGP version $templateAgpVersion' : 'Gradle version $templateGradleVersion';
969969
final VersionRange validJavaRange = gradle.getJavaVersionFor(gradleV: templateGradleVersion, agpV: templateAgpVersion);
970970
// validJavaRange should have non-null verisonMin and versionMax since it based on our template AGP and Gradle versions.
971-
final String validJavaRangeMessage = '(minimum compatible version: ${validJavaRange.versionMin!}, maximum compatible version: ${validJavaRange.versionMax!})';
971+
final String validJavaRangeMessage = '(Java ${validJavaRange.versionMin!} <= compatible Java version < Java ${validJavaRange.versionMax!})';
972972

973973
return '''
974974
The configured version of Java detected may conflict with the $incompatibleDependency version in your new Flutter $projectType.

0 commit comments

Comments
 (0)