flutter/packages/flutter_tools/templates/module
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
..
android [Android] Add Java/AGP/Gradle incompatibility warning to flutter create (#131444) 2023-09-20 16:01:04 +00:00
common Native assets support for MacOS and iOS (#130494) 2023-09-10 08:07:13 +00:00
ios iOS info.plist template: make UIViewControllerBasedStatusBar to be true (#128970) 2023-06-20 18:11:18 +00:00
README.md Rename 'application' back to 'module', and make 'app' the default again for templates. (#22888) 2018-10-10 11:01:40 -07:00

Templates for Flutter Module

common

Written to root of Flutter application.

Adds Dart project files including pubspec.yaml.

android

library

Written to the .android/ hidden folder.

Contents wraps Flutter/Dart code as a Gradle project that defines an Android library.

Executing ./gradlew flutter:assembleDebug in that folder produces a .aar archive.

Android host apps can set up a dependency to this project to consume Flutter views.

gradle

Written to .android/ or android/.

Mixin for adding Gradle boilerplate to Android projects.

host_app_common

Written to either .android/ or android/.

Contents define a single-Activity, single-View Android host app with a dependency on the .android/Flutter library.

Executing ./gradlew app:assembleDebug in the target folder produces an .apk archive.

Used with either android_host_ephemeral or android_host_editable.

host_app_ephemeral

Written to .android/ on top of android_host_common.

Combined contents define an ephemeral (hidden, auto-generated, under Flutter tooling control) Android host app with a dependency on the .android/Flutter library.

host_app_editable

Written to android/ on top of android_host_common.

Combined contents define an editable (visible, one-time generated, under app author control) Android host app with a dependency on the .android/Flutter library.

ios

library

Written to the .ios/Flutter hidden folder.

Contents wraps Flutter/Dart code for consumption by an Xcode project.

iOS host apps can set up a dependency to this contents to consume Flutter views.

host_app_ephemeral

Written to .ios/ outside the Flutter/ sub-folder.

Combined contents define an ephemeral (hidden, auto-generated, under Flutter tooling control) iOS host app with a dependency on the .ios/Flutter folder contents.

The host app does not make use of CocoaPods, and is therefore suitable only when the Flutter part declares no plugin dependencies.

host_app_ephemeral_cocoapods

Written to .ios/ on top of host_app_ephemeral.

Adds CocoaPods support.

Combined contents define an ephemeral host app suitable for when the Flutter part declares plugin dependencies.