flutteractionsbot 31c0ff4763
[CP-beta]Support host android apps with kts gradle files for add to app (#157881)
This pull request is created by [automatic cherry pick workflow](https://github.com/flutter/flutter/blob/main/docs/releases/Flutter-Cherrypick-Process.md#automatically-creates-a-cherry-pick-request)
Please fill in the form below, and a flutter domain expert will evaluate this cherry pick request.

### Issue Link:
What is the link to the issue this cherry-pick is addressing?

This allows host Android apps using Kotlin Gradle files to depend on a Flutter module as source, see
https://docs.flutter.dev/add-to-app/android/project-setup#add-the-flutter-module-as-a-dependency. 

Previously they wouldn't be able to, because we expected the host app to use `setBinding` in it's Gradle files, which is Groovy syntax that doesn't have a parallel in the Kotlin Gradle DSL. They could still depend on a flutter module if built as an aar.

### Changelog Description:
Explain this cherry pick in one line that is accessible to most Flutter developers. See [best practices](https://github.com/flutter/flutter/blob/main/docs/releases/Hotfix-Documentation-Best-Practices.md) for examples

Allows host Android apps using Kotlin Gradle files to include a Flutter module.

### Impact Description:
What is the impact (ex. visual jank on Samsung phones, app crash, cannot ship an iOS app)? Does it impact development (ex. flutter doctor crashes when Android Studio is installed), or the shipping production app (the app crashes on launch)

Without this change, Android apps using Kotlin Gradle files are unable to depend on a Flutter module as source (they would still be able to as an aar).

### Workaround:
Is there a workaround for this issue?

Build the flutter module as an aar.

### Risk:
What is the risk level of this cherry-pick?

### Test Coverage:
Are you confident that your fix is well-tested by automated tests?

### Validation Steps:
What are the steps to validate that this fix works?

Create a new Android app (probably in Android studio).
Create a Flutter module (`flutter create foobar --template=module`).
Apply [this diff](1f1e92ac79), matching names to your specific case, to the Android app.
2024-11-05 19:56:37 +00:00
..
2024-06-17 19:39:12 +02:00
2024-10-01 22:45:08 +00:00

This directory contains tools and resources that the Flutter team uses during the development of the framework. The tools in this directory should not be necessary for developing Flutter applications, though of course, they may be interesting if you are curious.

The tests in this directory are run in the framework_tests_misc-* shards.