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

[Many] Bump AGP to 8.5.1 and gradle to 8.7 #7432

Merged
merged 15 commits into from
Aug 20, 2024

Conversation

gmackall
Copy link
Member

@gmackall gmackall commented Aug 16, 2024

Upgrades all AGP versions less than 8 to latest. The primary motivation is to prepare for flutter/flutter#136879 (comment), which requires that plugins use a non-7.3 version. We believe it only affects version 7.3 - I'm going to test this, but am not sure the exact range yet and updating is independently valuable, so I just updated all pre 8 versions (it doesn't affect 8+).

Also:

  • Upgrades Gradle versions as required
  • Marks the use of Camera2Interop with @OptIn, as it is required by the newer AGP version.
  • Changes the Camerax example java directory path to align with the package xml attribute/AGP namespace attribute.
  • Sets android.buildFeatures.buildConfig to true for compatibility with AGP 8.0+ in some places.
  • Sets exported=true in a manifest, requires for AGP bump.
  • Updates espresso in some examples, required by the AGP bump (0.2.0 isn't compatible with AGP 8.0+).

Also related to flutter/flutter#146660

Pre-launch Checklist

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

Copy link
Contributor

@tarrinneal tarrinneal left a comment

Choose a reason for hiding this comment

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

pigeon, image_picker, shared_preferences lgtm

Copy link
Contributor

@stuartmorgan stuartmorgan left a comment

Choose a reason for hiding this comment

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

LGTM, but please make the PR description and title more descriptive and accurate. Almost none of the packages being touched here appear to be using AGP 7.3, so that's confusing, and then it's also updating Gradle and some miscellaneous other things like the annotations (which I assume are required for the update, so that's fine, but calling them out in the description would still be helpful).

@reidbaker reidbaker changed the title Upgrade off of AGP 7.3 [Many] Bump AGP to 8.5.1 and gradle to 8.7 Aug 20, 2024
@reidbaker
Copy link
Contributor

LGTM, but please make the PR description and title more descriptive and accurate. Almost none of the packages being touched here appear to be using AGP 7.3, so that's confusing, and then it's also updating Gradle and some miscellaneous other things like the annotations (which I assume are required for the update, so that's fine, but calling them out in the description would still be helpful).

I updated the pr title but please still add a reason for the @OptIn annotation in the pr description.

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

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

Choose a reason for hiding this comment

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

I understand if you want this in another pr but we also need to migrate to the plugin version of this import.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes we should do that at some point, but would prefer for it not to be this pr

@gmackall
Copy link
Member Author

gmackall commented Aug 20, 2024

@stuartmorgan and @reidbaker - updated.

Also, the changelog/version validation step is failing for interactive media ads - I'm assuming I should override? I only made changes to the pubspec/gradle files of the example app.

@reidbaker
Copy link
Contributor

@stuartmorgan and @reidbaker - updated.

Also, the repo checks are failing for interactive media ads - I'm assuming I should override? I only made changes to the pubspec/gradle files of the example app.

That is probably a question for @bparrishMines

@bparrishMines
Copy link
Contributor

bparrishMines commented Aug 20, 2024

Overriding for interactive_media_ads is fine with me since you are only changing the example. We'll need to investigate in the tool why it is failing though. This shouldn't block this PR though.

Copy link
Contributor

@bparrishMines bparrishMines left a comment

Choose a reason for hiding this comment

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

LGTM

@bparrishMines
Copy link
Contributor

@stuartmorgan
Copy link
Contributor

@stuartmorgan It looks like settings.gradle is missing from this list: https://github.com/flutter/packages/blob/main/script/tool/lib/src/common/package_state_utils.dart#L220

Yep, @gmackall Feel free to add that to this PR.

@gmackall
Copy link
Member Author

@stuartmorgan It looks like settings.gradle is missing from this list: https://github.com/flutter/packages/blob/main/script/tool/lib/src/common/package_state_utils.dart#L220

Yep, @gmackall Feel free to add that to this PR.

Added

@gmackall gmackall added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 20, 2024
@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Aug 20, 2024
Copy link
Contributor

auto-submit bot commented Aug 20, 2024

auto label is removed for flutter/packages/7432, due to - The status or check suite Linux_android android_device_tests_shard_2 master has failed. Please fix the issues identified (or deflake) before re-applying this label.

@gmackall gmackall added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 20, 2024
@auto-submit auto-submit bot merged commit 9cc09f1 into flutter:main Aug 20, 2024
76 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 21, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Aug 21, 2024
flutter/packages@4d2d2e3...4e5d47e

2024-08-21 stuartmorgan@google.com [webview_flutter] Endorse macOS (flutter/packages#7457)
2024-08-21 mhvdijk@gmail.com [flutter_adaptive_scaffold] Fix landscape not showing in andUp (flutter/packages#7425)
2024-08-20 47866232+chunhtai@users.noreply.github.com [go_router] Fixes replace and pushReplacement uri when only one route� (flutter/packages#7433)
2024-08-20 engine-flutter-autoroll@skia.org Roll Flutter from 6a28048 to e7da16d (23 revisions) (flutter/packages#7459)
2024-08-20 47866232+chunhtai@users.noreply.github.com [go_router] Fixes an issue where android back button pops wrong page. (flutter/packages#7348)
2024-08-20 34871572+gmackall@users.noreply.github.com [Many] Bump AGP to 8.5.1 and gradle to 8.7 (flutter/packages#7432)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Aug 23, 2024
…m code" (#153868)

Re-lands #136880, fixes #136879.

Additions to/things that are different from the original PR:
- Adds an entry to `gradle_errors.dart` that tells people when they run into the R8 bug because of using AGP 7.3.0 (https://issuetracker.google.com/issues/242308990).
- Previous PR moved templates off of AGP 7.3.0.
- Packages repo has been moved off AGP 7.3.0 (flutter/packages#7432).

Also, unrelatedly:
- Deletes an entry in `gradle_errors.dart` that informed people to build with `--no-shrink`. This flag [doesn't do anything](flutter/website#11022 (comment)), so it can't be the solution to any error.
- Uniquely lowers the priority of the `incompatibleKotlinVersionHandler`. This is necessary because the ordering of the errors doesn't fully determine the priority of which handler we decide to use, but also the order of the log lines. The kotlin error lines often print before the other error lines, so putting it last in the list of handlers isn't sufficient to lower it to be the lowest priority handler.
Buchimi pushed a commit to Buchimi/flutter that referenced this pull request Sep 2, 2024
flutter/packages@4d2d2e3...4e5d47e

2024-08-21 stuartmorgan@google.com [webview_flutter] Endorse macOS (flutter/packages#7457)
2024-08-21 mhvdijk@gmail.com [flutter_adaptive_scaffold] Fix landscape not showing in andUp (flutter/packages#7425)
2024-08-20 47866232+chunhtai@users.noreply.github.com [go_router] Fixes replace and pushReplacement uri when only one route� (flutter/packages#7433)
2024-08-20 engine-flutter-autoroll@skia.org Roll Flutter from 6a28048 to e7da16d (23 revisions) (flutter/packages#7459)
2024-08-20 47866232+chunhtai@users.noreply.github.com [go_router] Fixes an issue where android back button pops wrong page. (flutter/packages#7348)
2024-08-20 34871572+gmackall@users.noreply.github.com [Many] Bump AGP to 8.5.1 and gradle to 8.7 (flutter/packages#7432)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Buchimi pushed a commit to Buchimi/flutter that referenced this pull request Sep 2, 2024
…m code" (flutter#153868)

Re-lands flutter#136880, fixes flutter#136879.

Additions to/things that are different from the original PR:
- Adds an entry to `gradle_errors.dart` that tells people when they run into the R8 bug because of using AGP 7.3.0 (https://issuetracker.google.com/issues/242308990).
- Previous PR moved templates off of AGP 7.3.0.
- Packages repo has been moved off AGP 7.3.0 (flutter/packages#7432).

Also, unrelatedly:
- Deletes an entry in `gradle_errors.dart` that informed people to build with `--no-shrink`. This flag [doesn't do anything](flutter/website#11022 (comment)), so it can't be the solution to any error.
- Uniquely lowers the priority of the `incompatibleKotlinVersionHandler`. This is necessary because the ordering of the errors doesn't fully determine the priority of which handler we decide to use, but also the order of the log lines. The kotlin error lines often print before the other error lines, so putting it last in the list of handlers isn't sufficient to lower it to be the lowest priority handler.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants