flutter/packages/flutter_tools/lib/src/commands
Camille Simon 594ff98a65
[Android] Add Java/AGP/Gradle incompatibility warning to flutter create (#131444)
Adds warning to `flutter create` command that checks if detected Java version is compatible with the template AGP and template Gradle versions. If a developer is building for Android and their Java version is incompatible with either the AGP or Gradle versions that Flutter currently supports by default for new Flutter projects, then

- a warning will show noting the incompatibility and
- steps will be shown to fix the issue, the recommended option being to configure a new compatible Java version given that Flutter knows we can support the template Gradle/AGP versions and updating them manually may be risky (feedback on this approach would be greatly appreciated!)

Given that the template AGP and Gradle versions are compatible, this PR assumes that the detected Java version may only conflict with one of the template AGP or Gradle versions because:
 - the minimum Java version for a given AGP version is less than the maximum Java version compatible for the minimum Gradle version required for that AGP version (too low a Java version will fail AGP compatibility test, but not Gradle compatibility).
- the maximum Java version compatible with minimum Gradle version for a given AGP version is higher than minimum Java version required for that AGP version (too high a Java version will fail Gradle compatibility test, but not AGP compatibility test).

Fixes https://github.com/flutter/flutter/issues/130515 in the sense that `flutter create foo`; `cd foo`; `flutter run` should always be successful.
2023-09-20 16:01:04 +00:00
..
analyze_base.dart Make --flutter-repo analyze whole repo (#127990) 2023-06-02 17:17:54 +00:00
analyze_continuously.dart Make --flutter-repo analyze whole repo (#127990) 2023-06-02 17:17:54 +00:00
analyze_once.dart Make --flutter-repo analyze whole repo (#127990) 2023-06-02 17:17:54 +00:00
analyze.dart Makes scheme and target optional parameter when getting universal lin… (#134571) 2023-09-15 21:01:05 +00:00
android_analyze.dart Add android analyzer commands for applinks (#131009) 2023-08-23 21:11:51 +00:00
assemble.dart [flutter_tools] fix cast error when dart-defines-json file includes null (#128909) 2023-06-16 18:12:22 +00:00
attach.dart Enable private field promotion for flutter_tools (#134474) 2023-09-12 20:20:04 +00:00
build_aar.dart flutter-tool: enum cleanup (#124760) 2023-04-14 01:55:05 +00:00
build_apk.dart Revert "[flutter_tools] Remove sound null safety flag (#123031)" (#123280) 2023-03-22 22:53:49 +00:00
build_appbundle.dart flutter-tool: enum cleanup (#124760) 2023-04-14 01:55:05 +00:00
build_bundle.dart Revert "[flutter_tools] Remove sound null safety flag (#123031)" (#123280) 2023-03-22 22:53:49 +00:00
build_ios_framework.dart Native assets support for MacOS and iOS (#130494) 2023-09-10 08:07:13 +00:00
build_ios.dart [tools/ios_build_ipa] fallback to CFBundleName if CFBundleDisplayName is absent (#130752) 2023-07-17 22:21:07 +00:00
build_linux.dart Reduce usage of testUsingContext (#131078) 2023-07-24 17:22:25 +00:00
build_macos_framework.dart Native assets support for MacOS and iOS (#130494) 2023-09-10 08:07:13 +00:00
build_macos.dart Revert "[flutter_tools] Remove sound null safety flag (#123031)" (#123280) 2023-03-22 22:53:49 +00:00
build_web.dart [flutter_tools] disallow -O0 for flutter build web (#134185) 2023-09-11 23:33:09 +00:00
build_windows.dart Revert "[flutter_tools] Remove sound null safety flag (#123031)" (#123280) 2023-03-22 22:53:49 +00:00
build.dart Revert "[flutter_tools] Remove sound null safety flag (#123031)" (#123280) 2023-03-22 22:53:49 +00:00
channel.dart [flutter_tools] Suppress git output in flutter channel (#128475) 2023-06-13 19:28:06 +00:00
clean.dart feature/clean-a-specific-scheme: Add this-scheme new flag for clean command (#116733) 2023-02-21 17:35:13 +00:00
config.dart Clean up analytics opt in/out flags (#132588) 2023-09-12 22:49:05 +00:00
create_base.dart [Android] Add Java/AGP/Gradle incompatibility warning to flutter create (#131444) 2023-09-20 16:01:04 +00:00
create.dart [Android] Add Java/AGP/Gradle incompatibility warning to flutter create (#131444) 2023-09-20 16:01:04 +00:00
custom_devices.dart Workaround for Dart VM timeout (#127875) 2023-06-02 17:17:57 +00:00
daemon.dart Allow passing verbose log from flutter daemon. (#132828) 2023-08-25 04:26:56 +00:00
debug_adapter.dart [flutter_tools] Clean up boolArgDeprecated and stringArgDeprecated (#122184) 2023-03-13 21:20:19 +00:00
devices.dart Device discovery output cleanup (#131223) 2023-07-28 21:37:00 +00:00
doctor.dart [flutter_tools] cache flutter sdk version to disk (#124558) 2023-06-15 00:20:30 +00:00
downgrade.dart [flutter_tools] cache flutter sdk version to disk (#124558) 2023-06-15 00:20:30 +00:00
drive.dart [flutter_tools] only try to take a screenshot from flutter drive if the --screenshot flag is passed (#127150) 2023-05-19 19:14:17 +00:00
emulators.dart [flutter_tools] Clean up boolArgDeprecated and stringArgDeprecated (#122184) 2023-03-13 21:20:19 +00:00
generate_localizations.dart Relax syntax for gen-l10n (#130736) 2023-07-18 13:59:48 -07:00
generate.dart Migrate doctor, format, and a few other commands to null safety (#92952) 2021-11-03 17:36:32 -07:00
ide_config.dart [flutter_tools] Clean up boolArgDeprecated and stringArgDeprecated (#122184) 2023-03-13 21:20:19 +00:00
install.dart Add flag to filter by device connection interface (#124034) 2023-04-04 22:33:26 +00:00
ios_analyze.dart Makes scheme and target optional parameter when getting universal lin… (#134571) 2023-09-15 21:01:05 +00:00
logs.dart Add flag to filter by device connection interface (#124034) 2023-04-04 22:33:26 +00:00
make_host_app_editable.dart Migrate channel, clean and a few other commands to null safety (#92950) 2021-11-03 17:33:05 -07:00
packages.dart [flutter_tools] Generate localizations on flutter pub get (#132172) 2023-08-18 15:01:09 +00:00
precache.dart [flutter_tools] Precache after channel switch (#118129) 2023-06-09 01:46:24 +00:00
run.dart [flutter_tools] hide Skia specific rendering options. (#132509) 2023-08-14 20:54:15 +00:00
screenshot.dart Add flag to filter by device connection interface (#124034) 2023-04-04 22:33:26 +00:00
shell_completion.dart [flutter_tools] Clean up boolArgDeprecated and stringArgDeprecated (#122184) 2023-03-13 21:20:19 +00:00
symbolize.dart Add spaces after flow control statements (#126320) 2023-05-15 11:07:30 +02:00
test.dart [flutter_tools] Support coverage collection for dependencies (#129513) 2023-07-17 08:42:13 +00:00
update_packages.dart Unpin url launcher (remake) (#134958) 2023-09-20 02:43:57 +00:00
upgrade.dart [flutter_tools] Fix flutter upgrade not finding git tags (#133778) 2023-08-31 22:01:10 +00:00
validate_project.dart Add spaces after flow control statements (#126320) 2023-05-15 11:07:30 +02:00