Skip to content

Conversation

@flutteractionsbot
Copy link

@flutteractionsbot flutteractionsbot commented Dec 11, 2024

This pull request is created by automatic cherry pick workflow
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?

#159729

Changelog Description:

Explain this cherry pick in one line that is accessible to most Flutter developers. See best practices for examples

#159729: Warning in logs after a fresh flutter module create when building an aar for android.

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)

Warning after flutter create of a module.

Workaround:

Is there a workaround for this issue?

Manual migration after flutter create.

Risk:

What is the risk level of this cherry-pick?

  • Low
  • Medium
  • High

Test Coverage:

Are you confident that your fix is well-tested by automated tests?

  • Yes
  • No

Validation Steps:

What are the steps to validate that this fix works?

create module then build as app or aar then look in logs for warnings about gradle imperative apply

…adle Plugin (flutter#159770)

Fixes flutter#159729

Cases to consider:
1. Building the module as a standalone app (`flutter run`)
2. Building the module as an aar (`flutter build aar`) 
3. Doing (2) and then building an android host app that depends on the
aar.
4. Building the host app with it depending on the module as source.

Manually tested all 4 and they all are working.

Modified `build_android_host_app_with_module_aar.dart` and
`build_android_host_app_with_module_source.dart` to add checks on
`stderr` to ensure we don't hit the log.


## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

---------

Co-authored-by: Gray Mackall <[email protected]>
@flutteractionsbot flutteractionsbot added the cp: review Cherry-picks in the review queue label Dec 11, 2024
@flutteractionsbot
Copy link
Author

@reidbaker please fill out the PR description above, afterwards the release team will review this request.

@github-actions github-actions bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Dec 11, 2024
@christopherfujino
Copy link
Contributor

We have some build failures here:

[2024-12-11 07:22:11.288404] [STDOUT] stdout:            * What went wrong:
[2024-12-11 07:22:11.288539] [STDOUT] stdout:            An exception occurred applying plugin request [id: 'com.android.library']
[2024-12-11 07:22:11.288661] [STDOUT] stdout:            > Failed to apply plugin 'com.android.internal.library'.
[2024-12-11 07:22:11.288784] [STDOUT] stdout:               > Could not create plugin of type 'LibraryPlugin'.
[2024-12-11 07:22:11.289070] [STDOUT] stdout:                  > Could not generate a decorated class for type LibraryPlugin.
[2024-12-11 07:22:11.289192] [STDOUT] stdout:                     > org/gradle/api/configuration/BuildFeatures
[2024-12-11 07:22:11.289504] [STDOUT] stdout:            * Exception is:
[2024-12-11 07:22:11.289541] [STDOUT] stdout:            org.gradle.api.plugins.InvalidPluginException: An exception occurred applying plugin request [id: 'com.android.library']

From: https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20build_aar_module_test/18199/infra

@gmackall
Copy link
Member

We have some build failures here:

[2024-12-11 07:22:11.288404] [STDOUT] stdout:            * What went wrong:
[2024-12-11 07:22:11.288539] [STDOUT] stdout:            An exception occurred applying plugin request [id: 'com.android.library']
[2024-12-11 07:22:11.288661] [STDOUT] stdout:            > Failed to apply plugin 'com.android.internal.library'.
[2024-12-11 07:22:11.288784] [STDOUT] stdout:               > Could not create plugin of type 'LibraryPlugin'.
[2024-12-11 07:22:11.289070] [STDOUT] stdout:                  > Could not generate a decorated class for type LibraryPlugin.
[2024-12-11 07:22:11.289192] [STDOUT] stdout:                     > org/gradle/api/configuration/BuildFeatures
[2024-12-11 07:22:11.289504] [STDOUT] stdout:            * Exception is:
[2024-12-11 07:22:11.289541] [STDOUT] stdout:            org.gradle.api.plugins.InvalidPluginException: An exception occurred applying plugin request [id: 'com.android.library']

From: https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20build_aar_module_test/18199/infra

I believe this should be fixed by #160108

@reidbaker
Copy link
Contributor

We have some build failures here:

[2024-12-11 07:22:11.288404] [STDOUT] stdout:            * What went wrong:
[2024-12-11 07:22:11.288539] [STDOUT] stdout:            An exception occurred applying plugin request [id: 'com.android.library']
[2024-12-11 07:22:11.288661] [STDOUT] stdout:            > Failed to apply plugin 'com.android.internal.library'.
[2024-12-11 07:22:11.288784] [STDOUT] stdout:               > Could not create plugin of type 'LibraryPlugin'.
[2024-12-11 07:22:11.289070] [STDOUT] stdout:                  > Could not generate a decorated class for type LibraryPlugin.
[2024-12-11 07:22:11.289192] [STDOUT] stdout:                     > org/gradle/api/configuration/BuildFeatures
[2024-12-11 07:22:11.289504] [STDOUT] stdout:            * Exception is:
[2024-12-11 07:22:11.289541] [STDOUT] stdout:            org.gradle.api.plugins.InvalidPluginException: An exception occurred applying plugin request [id: 'com.android.library']

From: https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20build_aar_module_test/18199/infra

I will stack #160108 on top of this pr once it is landed.

@itsjustkevin
Copy link
Contributor

flutter-3.27-candidate.0 is no longer the beta branch.

…ates (flutter#160108)

flutter#159770 regressed the module
templates to use a hardcoded `8.7.0` and `1.8.22` as the AGP and Kotlin
versions respectively. This PR returns them to using the template
context values.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

---------

Co-authored-by: Gray Mackall <[email protected]>
@reidbaker
Copy link
Contributor

flutter-3.27-candidate.0 is no longer the beta branch.

We still want this targeting 3.27

@itsjustkevin itsjustkevin changed the title [CP-beta]Migrate module templates to declarative application of the Flutter Gradle Plugin [CP-stable]Migrate module templates to declarative application of the Flutter Gradle Plugin Dec 16, 2024
Copy link
Contributor

@christopherfujino christopherfujino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@christopherfujino christopherfujino added the autosubmit Merge PR when tree becomes green via auto submit App label Jan 9, 2025
@auto-submit auto-submit bot merged commit 4429073 into flutter:flutter-3.27-candidate.0 Jan 9, 2025
122 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 14, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 14, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App cp: review Cherry-picks in the review queue tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants