Add our own wrapper for CommonExtension due to change in signature from 8.x->9.0#184433
Conversation
CommonExtension due to change in signature from 8.x->9.0
There was a problem hiding this comment.
Code Review
This pull request introduces the AgpCommonExtensionWrapper class to address binary incompatibilities in the Android Gradle Plugin's CommonExtension between versions 8.x and 9.x. The wrapper delegates property and method access to specific Android extension types, such as ApplicationExtension and LibraryExtension, without directly importing CommonExtension. FlutterPluginUtils is updated to return this wrapper, and unit tests are adjusted to mock the necessary interfaces and build types. Feedback suggests that the ndkVersion property in the wrapper should be nullable to align with the Android Gradle Plugin DSL and prevent potential runtime errors.
| } | ||
| } | ||
|
|
||
| var ndkVersion: String |
There was a problem hiding this comment.
The ndkVersion property in the Android Gradle Plugin DSL is nullable. Declaring it as a non-nullable String in this wrapper could lead to a NullPointerException or a type mismatch at runtime if the property is not explicitly set in the build script.
| var ndkVersion: String | |
| var ndkVersion: String? |
…anch' into copy_agp_wrapper_branch
…signature from 8.x->9.0 (flutter/flutter#184433)
flutter/flutter@0f401ee...7245c3f 2026-04-03 [email protected] Roll Skia from c07c67045b6d to 5d847ba5c4aa (1 revision) (flutter/flutter#184570) 2026-04-03 [email protected] Roll Dart SDK from 3c7a79045b8b to 46f49142acd9 (1 revision) (flutter/flutter#184567) 2026-04-03 [email protected] Roll ICU from ee5f27adc28b to ff7995a708a1 (5 revisions) (flutter/flutter#184566) 2026-04-03 [email protected] Roll Skia from 9ae8231be181 to c07c67045b6d (4 revisions) (flutter/flutter#184562) 2026-04-03 [email protected] Roll Fuchsia Linux SDK from BFLjk6Uwd0gs_Hkdk... to PpL3Bn2YMb2h9LbdK... (flutter/flutter#184556) 2026-04-03 [email protected] Roll Skia from 0566b2f5f0d1 to 9ae8231be181 (1 revision) (flutter/flutter#184547) 2026-04-03 [email protected] Roll Dart SDK from 6008eaddd589 to 3c7a79045b8b (3 revisions) (flutter/flutter#184551) 2026-04-03 [email protected] Fix wide gamut macos integration test (flutter/flutter#184427) 2026-04-02 [email protected] forward an application name to DDS (flutter/flutter#184459) 2026-04-02 [email protected] Roll Skia from 973117cfa875 to 0566b2f5f0d1 (8 revisions) (flutter/flutter#184534) 2026-04-02 [email protected] Support different joins for stroked rects in uber_sdf, fix incorrect aa (flutter/flutter#184395) 2026-04-02 [email protected] [ Widget Preview ] Handle collections and records in custom preview annotations (flutter/flutter#184518) 2026-04-02 [email protected] Moves android_semantics_integration_test out of staging (flutter/flutter#184079) 2026-04-02 [email protected] Roll Packages from b3fcf14 to 66bf7ec (4 revisions) (flutter/flutter#184514) 2026-04-02 [email protected] Fix line breaks being lost when copying after selection gesture in SelectableRegion (flutter/flutter#184421) 2026-04-02 [email protected] Add plugin version to SwiftPM package symlink directory (flutter/flutter#183668) 2026-04-02 [email protected] Add our own wrapper for `CommonExtension` due to change in signature from 8.x->9.0 (flutter/flutter#184433) 2026-04-02 [email protected] [Android] Use EdgeToEdge.enable/WindowCompat for edge-to-edge mode instead of deprecated View flags (flutter/flutter#183072) 2026-04-02 [email protected] [data_assets] Cleanup tests (flutter/flutter#184209) 2026-04-02 [email protected] Enable SPM by default on Stable (flutter/flutter#184495) 2026-04-02 [email protected] Roll Dart SDK from d84bdfeb45eb to 6008eaddd589 (2 revisions) (flutter/flutter#184513) 2026-04-02 [email protected] Reland "Even more awaits" (flutter/flutter#184467) 2026-04-02 [email protected] Roll Skia from bb9fd8653739 to 973117cfa875 (2 revisions) (flutter/flutter#184498) 2026-04-02 [email protected] [ Widget Preview ] Use analysis server for widget preview detection (flutter/flutter#184473) 2026-04-02 [email protected] [web_ui] Fix avoid_type_to_string lint violation (flutter/flutter#184342) 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 Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: 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
…from 8.x->9.0 (flutter#184433) We can't reference this type directly because of: https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/CommonExtension https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/api/dsl/CommonExtension --------- Co-authored-by: Gray Mackall <[email protected]>
We can't reference this type directly because of:
https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/CommonExtension
https://developer.android.com/reference/tools/gradle-api/9.0/com/android/build/api/dsl/CommonExtension