Unverified Commit 54cf286e authored by Camille Simon's avatar Camille Simon Committed by GitHub

[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 https://github.com/flutter/flutter/pull/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.
parent 640050ba
......@@ -968,7 +968,7 @@ String getIncompatibleJavaGradleAgpMessageHeader(
final String incompatibleDependencyVersion = javaGradleVersionsCompatible ? 'AGP version $templateAgpVersion' : 'Gradle version $templateGradleVersion';
final VersionRange validJavaRange = gradle.getJavaVersionFor(gradleV: templateGradleVersion, agpV: templateAgpVersion);
// validJavaRange should have non-null verisonMin and versionMax since it based on our template AGP and Gradle versions.
final String validJavaRangeMessage = '(minimum compatible version: ${validJavaRange.versionMin!}, maximum compatible version: ${validJavaRange.versionMax!})';
final String validJavaRangeMessage = '(Java ${validJavaRange.versionMin!} <= compatible Java version < Java ${validJavaRange.versionMax!})';
return '''
The configured version of Java detected may conflict with the $incompatibleDependency version in your new Flutter $projectType.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment