Skip to content

Conversation

@flutteractionsbot
Copy link

@flutteractionsbot flutteractionsbot commented Oct 17, 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:

Part of #156111

Changelog Description:

Updates the Android plugin templates to use newer configurations that have better compatibility with recent versions of AGP.

Impact Description:

Without this, plugins created by flutter create will have deprecation warnings out of the box for developers whose projects use new versions of AGP, and will eventually fail to compile without manual updates.

Workaround:

Manually change the Java version after running 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:

  1. flutter create -t plugin some_plugin --platforms=android
  2. Update the example project to the latest version of AGP
  3. Build

There should not be warnings about source value 8 is obsolete or target value 8 is obsolete.

@flutteractionsbot flutteractionsbot added the cp: review Cherry-picks in the review queue label Oct 17, 2024
@flutteractionsbot
Copy link
Author

@stuartmorgan 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 Oct 17, 2024
@stuartmorgan-g stuartmorgan-g requested review from gmackall and reidbaker and removed request for reidbaker October 17, 2024 15:45
@stuartmorgan-g
Copy link
Contributor

@reidbaker @gmackall Thoughts on cherry-picking this to the new beta? It seems like getting this out sooner rather than later will slightly reduce problems overall, and it's low risk, but it's also something that individual developers could do themselves (if they know to).

@reidbaker
Copy link
Contributor

@reidbaker @gmackall Thoughts on cherry-picking this to the new beta? It seems like getting this out sooner rather than later will slightly reduce problems overall, and it's low risk, but it's also something that individual developers could do themselves (if they know to).

I am for this CP

@gmackall
Copy link
Member

I agree it is low risk and helpful, which is enough reason for me!

@reidbaker
Copy link
Contributor

reidbaker commented Oct 23, 2024

@gmackall can I get you to reformat the change log description to follow these best practices.

https://github.com/flutter/flutter/blob/master/docs/releases/Hotfix-Documentation-Best-Practices.md

In the past this was something a release engineer would do but we are moving to having cherry pickers do it since they have a better understanding of the change.

(or tell me to do it, i can do this one i am just running through the CP's this morning.

@itsjustkevin
Copy link
Contributor

@stuartmorgan this cherry-pick has failing tests that did not pass on rerun.

@stuartmorgan-g
Copy link
Contributor

@itsjustkevin Those failures don't look related to the PR (e.g., one is that a hot reload test is expecting a very specific success message and what's being output is a different success message). Are any CPs passing right now?

@itsjustkevin
Copy link
Contributor

itsjustkevin commented Nov 6, 2024

@stuartmorgan looks like Mac tool_integration_tests_5_5 is also failing on #158131.

@reidbaker
Copy link
Contributor

@bkonyi I think was looking at failures on that test.

@bkonyi
Copy link
Contributor

bkonyi commented Nov 6, 2024

The failure on Mac tool_integration_tests_2_5 has a fix up for review: #158271. I'm looking into the failure on Mac tool_integration_tests_5_5 now.

@bkonyi
Copy link
Contributor

bkonyi commented Nov 6, 2024

The failures on Mac tool_integration_tests_5_5 seem to be related to this issue: dart-lang/native#1698.

@mkustermann
Copy link
Member

mkustermann commented Nov 8, 2024

The failures on Mac tool_integration_tests_5_5 seem to be related to this issue: dart-lang/native#1698.

The check failure from build failure shows in the log

07:29 +31 -1: test/integration.shard/isolated/native_assets_test.dart: flutter build apk succeeds without libraries [E]
  Exception: flutter build failed: 1
  Unhandled exception:
  FormatException: No value was provided for required key: out_dir_shared
  #0      MapJsonUtils.get (package:native_assets_cli/src/json_utils.dart:50:7)
  #1      MapJsonUtils.path (package:native_assets_cli/src/json_utils.dart:25:48)
  #2      new HookConfig (package:native_assets_cli/src/config.dart:88:38)
  #3      new BuildConfig (package:native_assets_cli/src/config.dart)
  #4      build (package:native_assets_cli/src/api/build.dart:99:18)
  #5      main (file:///Volumes/Work/s/w/ir/x/t/pZaMJY/package_with_native_assets/hook/build.dart:4:9)
  #6      _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:295:33)
  #7      _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)
  Building native assets for package:package_with_native_assets failed.

The root cause for this is if the test uses newest package:native_assets_cli instead of a fixed version (so CI isn't hermetic/deterministic, tests can change results if something got uploaded to pub - which happend in this case) - the new 0.9.0 version of package:native_asset_cli can only be used from 3a83e43 onwards.

The offending code

  final ProcessResult result2 = await processManager.run(
    <String>[
      flutterBin,
      'pub',
      'add',
      'native_assets_cli',
    ],
    workingDirectory: packageDirectory.path,
  );
  expect(result2, const ProcessResultMatcher());

=> This was a problem in the test
=> I believe @matanlurey fix in cc90a42 resolved this

@reidbaker @bkonyi You may need to cherr-pick cc90a42.

Iff the cherry-picks to branches also include updating pub dependencies (i.e. updated via flutter upgrade-packages on the branch - especially if package:logging is upgraded), then you may also want to cherry-pick another fix to native asset tests, namely 31c1292

auto-submit bot pushed a commit that referenced this pull request Nov 8, 2024
Cherry-pick #158141.

Unblocks #157100 (comment).

This is a test-only change that works around `native_assets_cli` now being `0.9.0`.
@eyebrowsoffire eyebrowsoffire changed the base branch from flutter-3.26-candidate.0 to flutter-3.27-candidate.0 November 12, 2024 19:13
@github-actions github-actions bot added the a: desktop Running on desktop label Nov 12, 2024
eyebrowsoffire pushed a commit to eyebrowsoffire/flutter that referenced this pull request Nov 12, 2024
…lutter#158395)

Cherry-pick flutter#158141.

Unblocks flutter#157100 (comment).

This is a test-only change that works around `native_assets_cli` now being `0.9.0`.
// updated to handled synchronized
// groups/folders https://github.com/CocoaPods/CocoaPods/issues/12456
_logger.printError(
'Error: CocoaPods does not support Xcode 16 synchronized groups. '
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this change related to the bug listed? #156111

Copy link
Contributor

Choose a reason for hiding this comment

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

This was an issue from switching from the 3.26 branch target to the 3.27 branch target. I ended up doing a manual rebase and force pushed and that seems to have gotten rid of the unwanted changes.

Now that Flutter requires AGP 7+, we can use Java 11 as the compatibility version in the plugin template rather than 1.8, avoiding warnings with newer toolchains, and we can remove the check for 'namespace' existing that was only necessary to support AGP 4.1.

See also flutter/packages#7795 which made this change in Flutter-team-owned plugins.

Part of flutter#156111
@eyebrowsoffire eyebrowsoffire force-pushed the cp-beta-e8254b202492343a321b9a34b226bc82641f1b44 branch from 4b59236 to 75b2ac0 Compare November 13, 2024 00:24
@github-actions github-actions bot removed the a: desktop Running on desktop label Nov 13, 2024
@eyebrowsoffire eyebrowsoffire added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 13, 2024
@auto-submit auto-submit bot merged commit e466195 into flutter:flutter-3.27-candidate.0 Nov 13, 2024
123 checks passed
@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Nov 13, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 11, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

9 participants