8000 Fix Gradle 7 warnings that are now errors in Gradle 8 by beroso · Pull Request #121958 · flutter/flutter · GitHub
[go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Gradle 7 warnings that are now errors in Gradle 8 #121958

Merged
merged 10 commits into from
Mar 10, 2023

Conversation

beroso
Copy link
Contributor
@beroso beroso commented Mar 5, 2023

Pave the way to migrating to Gradle 8.
Following the manual: https://docs.gradle.org/current/userguide/upgrading_version_7.html#abstractarchivetask_api_cleanup

Fix #112858

Pre-launch Checklist

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

@flutter-dashboard flutter-dashboard bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Mar 5, 2023
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@bartekpacia
Copy link
Member

Did you check that you can build your app with Gradle 8? Because I'm pretty sure you can't.

See issue #117043 (specifically this comment), which was a warning in Gradle 7.x but is a fatal error in Gradle 8.

@CaseyHillers
Copy link
Contributor

We can test this by updating one of the tests to use Gradle 8. See #88540 for an example on the last time we did an upgrade to Gradle 7.

@beroso
Copy link
Contributor Author
beroso commented Mar 6, 2023

Did you check that you can build your app with Gradle 8? Because I'm pretty sure you can't.

See issue #117043 (specifically this comment), which was a warning in Gradle 7.x but is a fatal error in Gradle 8.

Sorry, I messed up here and I thought it was running properly. 🥲
I read your comment and tried to resolve the dependency problem. It's working but I don't know if it's the better approach.

@beroso
Copy link
Contributor Author
beroso commented Mar 6, 2023

@CaseyHillers Thank you for the hint!. I updated one benchmark test to Gradle 8 and hope it works

@@ -14,7 +14,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:7.2.0'
classpath 'com.android.tools.build:gradle:7.3.0'
Copy link
Contributor

Choose a reason for hiding this comment

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

This test doesn't run on presubmit (see https://github.com/flutter/flutter/blob/master/.ci.yaml). @reidbaker do you know of any presubmit tests we could uprev to verify the gradle 8 change?

Copy link
Contributor

Choose a reason for hiding this comment

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

@camsim99 Is this something you could help with?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I got it. Needed to run dev/tools/bin/generate_gradle_lockfiles.dart

Copy link
Contributor

Choose a reason for hiding this comment

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

Did it run in presubmit? It will for sure run if you modify the ci.yaml file @CaseyHillers linked above to see a successful run, then revert the change. For instance, you can take the related tasks like this one and change presubmit: false to presubmit: true.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok @camsim99. I will try it

@beroso beroso requested a review from keyonghan as a code owner March 7, 2023 02:47
.ci.yaml Outdated
@@ -1597,7 +1597,7 @@ targets:

- name: Linux_android complex_layout_android__compile
recipe: devicelab/devicelab_drone
presubmit: false
presubmit: true
Copy link
Contributor

Choose a reason for hiding this comment

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

Test is passing on presubmit. This LGTM once you remove the presubmit run here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@bartekpacia
Copy link
Member

I'm happy to see this fixed. I also created a very similar PR but was 12h slower than @beroso! 😅 So I'm going to close it.

BTW, I believe this PR now also fixes #117043 in addition to #112858.

@bartekpacia bartekpacia mentioned this pull request Mar 7, 2023
8 tasks
@beroso
Copy link
Contributor Author
beroso commented Mar 7, 2023

Thank you @bartekpacia ! Your comments was very helpful!

@christopherfujino
Copy link
Member

I scheduled a re-run of Mac build_ios_framework_module_test because it timed out due to an ongoing infra issue we are having with our mac ARM64 bots.

@reidbaker reidbaker added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 10, 2023
@auto-submit auto-submit bot merged commit d7e8517 into flutter:master Mar 10, 2023
hannah-hyj pushed a commit to hannah-hyj/flutter that referenced this pull request Mar 11, 2023
Fix Gradle 7 warnings that are now errors in Gradle 8
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 11, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 12, 2023
@beroso beroso deleted the 112858-fix-android-gradle-8 branch March 22, 2023 19:22
@beroso beroso mentioned this pull request Mar 22, 2023
CaseyHillers pushed a commit that referenced this pull request Apr 18, 2023
Pull the minimal set of changes from flutter 3.10 (in beta) into flutter
3.7 to support gradle 8.0
[124838](#124838)

[Original PR](#121958)
## 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.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] All existing and new tests are passing.

---------

Co-authored-by: André Sousa <andrelvsousa@gmail.com>
@mohamedmohamedy mohamedmohamedy mentioned this pull request Apr 27, 2023
16 tasks
@ilgnerND ilgnerND mentioned this pull request May 3, 2023
16 tasks
@aaarvaaan aaarvaaan mentioned this pull request May 9, 2023
16 tasks
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 10, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 10, 2023
This was referenced May 12, 2023
fluttermirroringbot pushed a commit that referenced this pull request Oct 26, 2023
Fixes #129471.

Does so by doing a very similar thing that is done by #121958, but for a task that is specific to the add to app build process.
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 tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flutter crashes when using Gradle 8.0
6 participants
0