Skip to content

Commit

Permalink
[Android] Update Java/AGP/Gradle warning compatible Java range (flutt…
Browse files Browse the repository at this point in the history
…er#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#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.
  • Loading branch information
camsim99 committed Oct 17, 2023
1 parent cd285a9 commit fd20eff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/flutter_tools/lib/src/commands/create.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit fd20eff

Please sign in to comment.