Skip to content

[flutter_tools] Do not copy app-only build type properties onto library plugins - #196692

Merged
reidbaker merged 9 commits into
flutter:masterfrom
reidbaker-agent:plugin-library-application-id-suffix
Nov 17, 2026
Merged

reidbaker merged 9 commits into
flutter:masterfrom
reidbaker-agent:plugin-library-application-id-suffix

Conversation

@reidbaker-agent

@reidbaker-agent reidbaker-agent commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #196412
Fixes #196696
Part of #196689

Since Flutter 3.50, an app fails to configure, even in debug mode, when it uses a plugin and one of its build types sets something that a library module can't have. Examples are applicationIdSuffix on profile (#196412), isShrinkResources (#196696) on a custom build type, or a buildConfigField or resValue. Example error:

A problem occurred configuring project ':jni'.
> com.android.builder.errors.EvalIssueException: Library projects cannot set applicationIdSuffix. applicationIdSuffix is set to '.profile' in build type 'profile'.

This is a regression of #169215. #191606 changed the Flutter Gradle Plugin to copy each app build type that a plugin lacks onto the plugin with initWith(appBuildType). In AGP 9.3.1, initWith copies every build type property (AbstractBuildType.initWith, BaseConfigImpl._initWith, BuildType._initWith), including several that AGP rejects in a library:

Property AGP error in the library
applicationIdSuffix Library projects cannot set applicationIdSuffix
isShrinkResources Resource shrinker cannot be used for libraries. The check runs inside initWith, so the value can't be reset afterwards.
buildConfigFields contains custom BuildConfig fields, but the feature is disabled
resValues contains custom resource values, but the feature is disabled

The this is ApplicationBuildType check that was meant to keep app-only properties away from library plugins is always true. AGP uses one build type class for every module type, and it implements ApplicationBuildType, LibraryBuildType, DynamicFeatureBuildType and TestBuildType.

This PR:

  • Uses initWith only for plugins that are built as apps (isBuiltAsApp, as fix: only use library props for libraries #172704 did). An app accepts every build type property, and initWith already copies isDebuggable, so app plugins no longer set it separately.
  • Gives library plugins only matchingFallbacks and isDebuggable, in a separate copyLibraryBuildTypeProperties function:
    • matchingFallbacks lets the plugin's own dependencies resolve. [AGP 9.1.0 Migration #4] Replace plugin build-type copy with initWith on public DSL #191606 meant to add it.
    • isDebuggable isn't in the public library DSL, but library variants still read it, for example for BuildConfig.DEBUG, R8's debuggable flag and the CMake build type of FFI plugins. It is set through the ApplicationBuildType interface that AGP's build type class implements, as in Flutter 3.47.
    • isMinifyEnabled is no longer copied (3.47 copied it). A minified library build type makes AGP run R8 on the plugin with only the plugin's keep rules. That removes the plugin class that GeneratedPluginRegistrant uses, and the app's R8 run fails with Missing class io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin. The app's R8 run already shrinks plugin code.
  • Updates the unit tests. The library build type mock implements both the library and application interfaces, like the real AGP class. The test checks that initWith isn't called and that isMinifyEnabled isn't set.
  • Extends android_plugin_example_app_build_test.dart, which builds the example app of the plugin and plugin_ffi templates against the real AGP. Before the first build, the test now adds applicationIdSuffix, versionNameSuffix, buildConfigField and resValue to the profile build type, and adds a staging build type with isMinifyEnabled and isShrinkResources. For the plugin template, it also runs ./gradlew :app:assembleStaging. The earlier tests were mock-only and checked that initWith was called, so they could not catch this.

Verified locally on 3.50.0 and master:

  • On stock 3.50.0, the repro from Cannot use applicationIdSuffix in the profile mode (Flutter 3.50) #196412 fails, and so do apps with only isShrinkResources or only buildConfigField. 3.47.9 builds them.
  • With this change, the Cannot use applicationIdSuffix in the profile mode (Flutter 3.50) #196412 repro builds with --debug and --profile. aapt2 dump badging shows package com.example.repro350.profile and versionName 1.0.0-PROFILE for the profile APK. An app with a staging build type that uses initWith(release), isMinifyEnabled and isShrinkResources builds with ./gradlew :app:assembleStaging.
  • On stock master and stock 3.50.0, both cases in android_plugin_example_app_build_test.dart fail with Resource shrinker cannot be used for libraries. and contains custom BuildConfig fields, but the feature is disabled. With this change, both cases pass on master and 3.50.0. If isMinifyEnabled is copied again, the plugin case fails with R8: Missing class com.example.plugin_test.PluginTestPlugin.
  • All Flutter Gradle Plugin unit tests pass on master against the default AGP and AGP 9.3.1, and on 3.50.0. ktlint and dart analyze are clean.
  • Tested on both ends of the supported AGP range: AGP 9.3.1 (the template default, with Gradle 9.5.0) and AGP 9.1.1 (the minimum in DependencyVersionChecker.kt, with Gradle 9.3.1). On AGP 9.1.1, both cases of android_plugin_example_app_build_test.dart pass with this change, covering the release APK, :app:assembleStaging and a profile APK. Without the change, they fail with the shrinker and BuildConfig errors. The Flutter Gradle Plugin unit tests also pass with -Pflutter.internal.agpVersion=9.1.1.

I intend to cherry-pick this into 3.50.x. The change applies to 3.50 without edits, because the 3 files it changes are the same on 3.50.0 and master. I ran the tests above on 3.50.0 with this change applied.

Pre-launch Checklist

…uild types

Since flutter#191606, the Flutter Gradle Plugin copies missing app build types onto
plugin projects with `initWith(appBuildType)`. AGP's `initWith` also copies
`applicationIdSuffix`, which AGP rejects in library modules, so an app that
set `applicationIdSuffix` on its profile build type failed to configure when
it used a plugin such as shared_preferences.

Use `isBuiltAsApp` again to tell app plugins from library plugins. For
library plugins, clear `applicationIdSuffix` after `initWith`.

Adds a unit test and an integration test that builds against the real AGP.

Fixes flutter#196412
@github-actions github-actions Bot added platform-android Android applications specifically tool Affects the "flutter" command-line tool. See also t: labels. team-android Owned by Android platform team labels Nov 16, 2026
`initWith` also copies isShrinkResources, buildConfigFields and resValues.
AGP rejects all of them in a library that has not enabled the matching
feature, and the isShrinkResources check fails inside `initWith` itself.
Library plugins now get only isMinifyEnabled, matchingFallbacks and
isDebuggable, which is what Flutter 3.47 copied, plus matchingFallbacks.

Extends the integration test to cover these settings and updates the
migration docs.
@github-actions github-actions Bot added the d: docs/ flutter/flutter/docs, for contributors label Nov 16, 2026
@reidbaker-agent reidbaker-agent changed the title [flutter_tools] Do not copy applicationIdSuffix onto library plugin build types [flutter_tools] Do not copy app-only build type properties onto library plugins Nov 16, 2026
@reidbaker reidbaker added the CICD Run CI/CD label Nov 16, 2026
@flutter-dashboard flutter-dashboard Bot removed the CICD Run CI/CD label Nov 16, 2026
@github-actions github-actions Bot removed the d: docs/ flutter/flutter/docs, for contributors label Nov 16, 2026
Comment on lines 161 to 170
if (pluginIsApp) {
initWith(appBuildType)
} else {
isMinifyEnabled = appBuildType.isMinifyEnabled
matchingFallbacks.addAll(appBuildType.matchingFallbacks)
}
// AGP uses one build type class for every module type, so this check
// also passes for library build types.
if (this is ApplicationBuildType && appBuildType is ApplicationBuildType) {
isDebuggable = appBuildType.isDebuggable

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This fix seems odd because why would we have an app check call init with the add build type then later check if this is an ApplicationBuildType and set debuggable.

There is a pattern here we need to check our assumptions on. What needs to be copied and how do we make sure the values are safe for apps and libraries (and are those the only types we need to ensure work).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You're right. Two things were wrong with that pattern:

  • For app plugins, the separate isDebuggable copy did nothing. AGP's initWith already copies isDebuggable (AbstractBuildType.initWith, com/android/builder/core/AbstractBuildType.kt:43 in AGP 9.3.1).
  • this is ApplicationBuildType can't tell an app from a library. AGP uses one BuildType class for every module type, and that class implements ApplicationBuildType, LibraryBuildType, DynamicFeatureBuildType and TestBuildType.

b08757b splits the code into two paths, chosen by isBuiltAsApp(pluginProject):

  • App plugins (com.android.application) use initWith and nothing else. An app accepts every build type property.
  • Library plugins use copyLibraryBuildTypeProperties, which copies only what a library needs.

What a library plugin needs. The main point of the copy is the build type itself. The app adds a <buildType>Api dependency on every plugin, so each plugin needs a build type with the same name for its variants to resolve. After that, the function copies:

  • matchingFallbacks, so the plugin's own dependencies resolve. It's public on BuildType and valid for libraries.
  • isDebuggable. The public library DSL doesn't have it, but library variants still read it (LibraryVariantDslInfoImpl.isDebuggable), for BuildConfig.DEBUG, R8's debuggable flag and the CMake build type of FFI plugins. It's set through the ApplicationBuildType cast, as in 3.47.

What it doesn't copy.

  • applicationIdSuffix, isShrinkResources, buildConfigFields and resValues: AGP rejects them in a library.
  • isMinifyEnabled: checking this turned up a second bug, fixed in 19b0cee. 3.47 copied it, but a minified library build type makes AGP run R8 on the plugin with only the plugin's keep rules. A staging { initWith(release) } build then fails in the app's R8 step with Missing class io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin. The app's R8 run already shrinks plugin code.
  • signingConfig, isJniDebuggable, isProfileable and the build type ndk/externalNativeBuild options: AGP uses them only to package or sign an app. The native options would pass the app's CMake arguments to an FFI plugin.

Module types.

  • Plugins are com.android.application, com.android.library or com.android.kotlin.multiplatform.library.
  • KMP plugins have no top-level android extension, so copyAppBuildTypesToPlugin returns early at hasProperty("android"). They have no build types to copy.
  • In add-to-app, project is itself a library. Its build types go through the same library path.
  • Any other module type would also take the library path, which copies nothing that AGP rejects.

The unit tests model AGP's single build type class and check that library plugins never get initWith or isMinifyEnabled. The integration test (see the other thread) checks the same thing against the real AGP.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Instead of a new test I think we should modify android_plugin_example_app_build_test.dart

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in b08757b and 19b0cee. The coverage now lives in android_plugin_example_app_build_test.dart, for both the plugin and plugin_ffi templates. android_plugin_app_build_type_properties_test.dart and its tool_test_durations.json entries are gone.

Before the first build, the test adds this to the example app's build.gradle.kts: a profile build type with applicationIdSuffix, versionNameSuffix, buildConfigField and resValue, and a staging build type with isMinifyEnabled and isShrinkResources. For the plugin template, it also runs ./gradlew :app:assembleStaging.

Local results:

  • Stock master and stock 3.50.0: both cases fail with Resource shrinker cannot be used for libraries. and contains custom BuildConfig fields, but the feature is disabled.
  • With this PR, on master and 3.50.0: both cases pass, in about 80 seconds for the whole file.
  • With this PR, but with isMinifyEnabled copied again: the plugin case fails with R8: Missing class com.example.plugin_test.PluginTestPlugin.

- App plugins copy each missing build type with initWith only. initWith
  already copies isDebuggable, so the separate isDebuggable copy was
  redundant for them.
- Library plugins copy isMinifyEnabled, matchingFallbacks and
  isDebuggable in a dedicated helper that documents why initWith can't
  be used and why the isDebuggable cast works.
- Move the integration coverage into
  android_plugin_example_app_build_test.dart, which now adds app-only
  build type settings to the example app for both plugin templates.
  Delete android_plugin_app_build_type_properties_test.dart and its
  tool_test_durations.json entries.
A minified library build type makes AGP run R8 on the plugin with only
the plugin's own keep rules, which removes the plugin classes that the
app's GeneratedPluginRegistrant uses. The app's R8 run then fails with
"Missing class". The app's R8 run already shrinks the plugin code, so
library plugins don't need the setting.

The integration test now also builds the example app's staging variant,
which fails with "Missing class" if isMinifyEnabled is copied again.
isDebuggable = appBuildType.isDebuggable
if (pluginIsApp) {
// An app accepts every build type property, so copy all of them.
// `initWith` copies isDebuggable too.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What does debuggable need to be mentioned separately?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It doesn't. That comment was left over from the old code, which set isDebuggable after initWith. Removed in a4584de, along with the matching comment in the unit test.

Comment on lines +182 to +184
* isMinifyEnabled is deliberately not copied either. A minified library runs R8 with
* only its own keep rules, which removes the plugin classes that the app's
* GeneratedPluginRegistrant uses. The app's R8 run already shrinks the plugin code.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Collapse this minified prose to something shorter.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Shortened in a4584de to one sentence each for what is skipped and why.

Comment on lines +172 to +182
* Copies the properties of [appBuildType] that a library needs onto
* [libraryBuildType], a build type of a library plugin.
*
* This deliberately doesn't use `initWith`, which copies every property. AGP rejects
* some of those properties in a library: applicationIdSuffix and isShrinkResources
* always, and buildConfigField and resValue unless the library enables those build
* features. See https://github.com/flutter/flutter/issues/169215,
* https://github.com/flutter/flutter/issues/196412 and
* https://github.com/flutter/flutter/issues/196696.
*
* isMinifyEnabled is deliberately not copied either. A minified library runs R8 with

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

way too long and no need to mention every bug that is related.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

a4584de now links only #196412.

Comment on lines +191 to +195
// The public library DSL has no isDebuggable, but library variants still use it,
// for example for BuildConfig.DEBUG. AGP implements every build type with one class
// that also implements ApplicationBuildType, so this check passes for libraries.
if (libraryBuildType is ApplicationBuildType && appBuildType is ApplicationBuildType) {
libraryBuildType.isDebuggable = appBuildType.isDebuggable

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

WHy is this the one type that is special?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

isDebuggable is the only property we copy that the library DSL hides. In AGP 9.3.1 (javap on gradle-api-9.3.1.jar), isDebuggable is declared on ApplicationBuildType, TestBuildType and DynamicFeatureBuildType, but not on BuildType or LibraryBuildType. matchingFallbacks is on BuildType, so it needs no cast.

Library variants still read isDebuggable, for BuildConfig.DEBUG, R8's debuggable flag and the CMake build type of FFI plugins. Without the copy, a staging { initWith(debug) } build type would be debuggable in the app and not in the plugins. AGP's single build type class implements ApplicationBuildType, so the cast is the only way to set it on a library build type without internal AGP classes.

a4584de shortens the comment above the cast to say this.


@Test
fun `configurePlugins copies app-specific properties when the plugin project is an app`(
fun `configurePlugins copies every build type property with initWith when the plugin project is an app`(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Where is the test that is similar to this one but for a library?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It is configurePlugins copies only library build type properties when the plugin project is a library. It was further up the file and named differently, so it was hard to find. In a4584de the two tests are next to each other and have matching names. The library test checks that initWith and isMinifyEnabled are not used, and that matchingFallbacks and isDebuggable are copied.

Comment on lines +45 to +47
// Regression test for https://github.com/flutter/flutter/issues/169215,
// https://github.com/flutter/flutter/issues/196412 and
// https://github.com/flutter/flutter/issues/196696.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Again you dont need to mention every bug that a pr fixes in the tests. Maybe one would make sense here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

a4584de now links only #196412.

Comment on lines +49 to +55
// The Flutter Gradle Plugin copies the app's build types onto library
// plugins that don't define them, such as this plugin and integration_test.
// The settings below break a library plugin if they are copied onto it:
// applicationIdSuffix and isShrinkResources are app-only, the plugins don't
// enable the buildConfig or resValues build features, and isMinifyEnabled
// strips the plugin classes. Gradle configures every build type, so any
// build catches the configuration errors.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I dont think this whole explanation makes sense at this point in the test code.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Cut to two lines in a4584de: what the block adds and why. I also shortened the comment before the assembleStaging build.

@reidbaker
reidbaker marked this pull request as ready for review November 16, 2026 21:33
@reidbaker
reidbaker requested a review from a team as a code owner November 16, 2026 21:33
@reidbaker
reidbaker requested review from gmackall and removed request for a team November 16, 2026 21:33

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates PluginHandler.kt to prevent copying incompatible application-specific build type properties onto library plugin projects. When a plugin is not built as an app, only library-compatible properties such as matchingFallbacks and isDebuggable are copied via a new copyLibraryBuildTypeProperties method, avoiding the use of initWith. Unit tests in PluginHandlerTest.kt and integration tests in android_plugin_example_app_build_test.dart have been updated to verify these changes. No review comments were provided for this pull request.

@reidbaker reidbaker left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

close

Comment on lines +173 to +175
* Unlike `initWith`, this skips app-only properties, such as applicationIdSuffix, that
* AGP rejects in a library (https://github.com/flutter/flutter/issues/196412). It also
* skips isMinifyEnabled, because the app's R8 run already shrinks the plugin code.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These are comment for maintainers and belong in // comment in the method not in the kt doc.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in 563a5dd. The KDoc is now one sentence about what the method does. The notes on skipping applicationIdSuffix and isMinifyEnabled are now // comments at the start of the method body.

@reidbaker reidbaker added the CICD Run CI/CD label Nov 16, 2026

@gmackall gmackall left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm in the sense that it makes sense for us to land this so our cherry pick more closely mirrors what we had before #191606, in order to lower risk

I'm skeptical that the pluginIsApp case is necessary or correct though - a plugin should not be an app, I think?

@reidbaker

Copy link
Copy Markdown
Member

lgtm in the sense that it makes sense for us to land this so our cherry pick more closely mirrors what we had before #191606, in order to lower risk

I'm skeptical that the pluginIsApp case is necessary or correct though - a plugin should not be an app, I think?

@gmackall and i talked out of band and I agree. It appears that this was incidental from 191606 and not intentional. There is other follow up work I want to land related to this but not cherry pick so I have added proving or disproving grays thoughts to that work.

@reidbaker reidbaker added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 17, 2026
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Nov 17, 2026
@auto-submit

auto-submit Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

autosubmit label was removed for flutter/flutter/196692, because - The status or check suite Presubmit has failed. Please fix the issues identified (or deflake) before re-applying this label.

@reidbaker reidbaker added the override code freeze Override an active code freeze. label Nov 17, 2026
@reidbaker
reidbaker enabled auto-merge November 17, 2026 02:43
@flutter-dashboard flutter-dashboard Bot removed the CICD Run CI/CD label Nov 17, 2026
@reidbaker reidbaker added the CICD Run CI/CD label Nov 17, 2026
@reidbaker
reidbaker added this pull request to the merge queue Nov 17, 2026
Merged via the queue into flutter:master with commit 534fb4d Nov 17, 2026
24 checks passed
@reidbaker
reidbaker deleted the plugin-library-application-id-suffix branch November 17, 2026 04:23
@reidbaker reidbaker added cp: beta cherry pick this pull request to beta release candidate branch cp: stable cherry pick this pull request to stable release candidate branch labels Nov 17, 2026
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Nov 17, 2026
flutter/flutter@d8bd864...2f09f96

2026-11-17 [email protected] Analyze every flutter create template, and fix the package_ffi lint (flutter/flutter#196165)
2026-11-17 [email protected] Roll Dart SDK from 50debf3c9757 to 26e38955d9d4 (3 revisions) (flutter/flutter#196772)
2026-11-17 [email protected] Manual roll ICU from b09986242cfb to d3c612f44146 (1 revision) (flutter/flutter#196713)
2026-11-17 [email protected] Roll Skia from 4f6b3a8d8565 to 503a380ebecc (19 revisions) (flutter/flutter#196768)
2026-11-17 [email protected] iOS: Don't mock UIView animations in keyboard spring animation test (flutter/flutter#196755)
2026-11-17 [email protected] [flutter_tools] Preserve index.html across --web-content-hash transitions (flutter/flutter#196491)
2026-11-17 [email protected] Fix TextStyle background color fade-out when lerping to null (flutter/flutter#196153)
2026-11-17 [email protected] Update desktop engine TESTOWNERS (flutter/flutter#196732)
2026-11-17 [email protected] [flutter_tools] Do not copy app-only build type properties onto library plugins (flutter/flutter#196692)
2026-11-17 [email protected] [flutter_tools] Remove service and runner ambient context getters (flutter/flutter#196571)
2026-11-17 [email protected] Bump customer tests (flutter/flutter#196740)
2026-11-17 [email protected] Take customer_testing_flame out of bringup (flutter/flutter#196570)
2026-11-17 [email protected] [devicelab] Read AssetManifest.bin from the APK in flavors_test (flutter/flutter#196736)
2026-11-17 [email protected] [flutter_tools] Fix flaky tool_tests_general by moving spawnUri tests to integration shard (flutter/flutter#195999)
2026-11-17 [email protected] Roll Dart SDK from 3e069c6fdbde to 50debf3c9757 (2 revisions) (flutter/flutter#196706)
2026-11-16 [email protected] [web] Record build finish synchronously in renderScene and fix dropped frame timings (flutter/flutter#195947)
2026-11-16 [email protected] Do not reveal obscured character when input is rejected by inputFormatters (flutter/flutter#195022)
2026-11-16 [email protected] Cla draft follow up: add waiting for response (flutter/flutter#196686)
2026-11-16 [email protected] Roll pub packages (flutter/flutter#196684)
2026-11-16 [email protected] Roll Packages from 015df97 to 4c6a7d3 (8 revisions) (flutter/flutter#196681)
2026-11-16 [email protected] Skip Vulkan impeller_unittests on macOS (flutter/flutter#196282)
2026-11-16 [email protected] Move the task runners out of Flutter Engine (flutter/flutter#196267)
2026-11-16 [email protected] [FGP] Add Flutter assets after AGP's asset merge so dotfiles are pack… (flutter/flutter#196465)
2026-11-16 [email protected] iOS: Add Obj-C model for platform view composition params (flutter/flutter#196498)
2026-11-16 [email protected] [Windows] Normalize Shift key messages with a non-standard scan code (flutter/flutter#193675)
2026-11-16 [email protected] Roll Skia from 118eaff3deb4 to 4f6b3a8d8565 (3 revisions) (flutter/flutter#196672)
2026-11-16 [email protected] Roll Dart SDK from c91e8b6674e2 to 3e069c6fdbde (4 revisions) (flutter/flutter#196669)

If this roll has caused a breakage, revert this CL and set the roller
to dry run mode 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
auto-submit Bot pushed a commit that referenced this pull request Nov 18, 2026
…nto library plugins (#196756)

### Issue Link:
#196412
and #196696

Companion beta cherry-pick: #196757

### Impact Description:
[#191606](#191606), part of the migration to AGP's public Variant API, changed how the Flutter Gradle Plugin creates missing app build types on plugin projects. It shipped in 3.50.0 and in the current beta, 3.51.0-0.1.pre. Up to 3.47, library plugins received a compatible build type without app-only properties (#172704). Since #191606, `PluginHandler` called `initWith(appBuildType)` for every plugin. In AGP 9, `initWith` copies every build type property, and AGP rejects several of them in a library module: `applicationIdSuffix` (#196412), `isShrinkResources` (including any custom build type created with `initWith(getByName("release"))`, because Flutter enables `isShrinkResources` on `release` by default; #196696), `buildConfigFields`, and `resValues`. Because Gradle configures every build type of every subproject, affected apps fail to configure even in `debug` mode (`flutter run`). In addition, copying `isMinifyEnabled` onto library plugins caused R8 to strip plugin classes on custom minified build types (`Missing class ...Plugin`).

This cherry-pick, [#196692](#196692) (`534fb4d6247`), restores separate handling for library plugins: plugins built as apps keep `initWith`, while library plugins receive only `matchingFallbacks` and `isDebuggable` (skipping app-only properties and `isMinifyEnabled`, because the app's R8 pass shrinks plugin code). It applied to `flutter-3.50-candidate.0` without conflicts (`0` diff vs `534fb4d6247`).

### Changelog Description:
[flutter/196412] When building an Android app with plugins and custom or app-only buildType settings, Gradle configuration fails.

### Workaround:
Pre-create the custom or `profile` build type in every library subproject from the root `android/build.gradle.kts` before Flutter copies it (`subprojects { pluginManager.withPlugin("com.android.library") { extensions.configure<com.android.build.api.dsl.LibraryExtension>("android") { buildTypes.maybeCreate("profile") } } }`), or for `applicationIdSuffix` set it via `androidComponents.onVariants`.

### Risk:
What is the risk level of this cherry-pick?

### Test Coverage:
Are you confident that your fix is well-tested by automated tests?

### Validation Steps:
1. Run `flutter create app && cd app && flutter pub add shared_preferences`.
2. In `android/app/build.gradle.kts`, set `applicationIdSuffix = ".profile"` on `profile` and add `create("staging") { initWith(getByName("release")) }` under `buildTypes`.
3. Run `flutter build apk --debug`, `flutter build apk --profile`, and `./gradlew -p android :app:assembleStaging`. All three succeed, and `aapt2 dump badging` on the profile APK shows package suffix `.profile`.
4. Covered by `PluginHandlerTest` and `android_plugin_example_app_build_test.dart` (verified on both AGP 9.1.1 and AGP 9.3.1).
auto-submit Bot pushed a commit that referenced this pull request Nov 18, 2026
…o library plugins (#196757)

### Issue Link:
#196412
and #196696

Companion stable cherry-pick: #196756

### Impact Description:
[#191606](#191606), part of the migration to AGP's public Variant API, changed how the Flutter Gradle Plugin creates missing app build types on plugin projects. It shipped in 3.50.0 and in the current beta, 3.51.0-0.1.pre. Up to 3.47, library plugins received a compatible build type without app-only properties (#172704). Since #191606, `PluginHandler` called `initWith(appBuildType)` for every plugin. In AGP 9, `initWith` copies every build type property, and AGP rejects several of them in a library module: `applicationIdSuffix` (#196412), `isShrinkResources` (including any custom build type created with `initWith(getByName("release"))`, because Flutter enables `isShrinkResources` on `release` by default; #196696), `buildConfigFields`, and `resValues`. Because Gradle configures every build type of every subproject, affected apps fail to configure even in `debug` mode (`flutter run`). In addition, copying `isMinifyEnabled` onto library plugins caused R8 to strip plugin classes on custom minified build types (`Missing class ...Plugin`).

This cherry-pick, [#196692](#196692) (`534fb4d6247`), restores separate handling for library plugins: plugins built as apps keep `initWith`, while library plugins receive only `matchingFallbacks` and `isDebuggable` (skipping app-only properties and `isMinifyEnabled`, because the app's R8 pass shrinks plugin code). It applied to `flutter-3.51-candidate.0` without conflicts (`0` diff vs `534fb4d6247`).

### Changelog Description:
[flutter/196412] When building an Android app with plugins and custom or app-only buildType settings, Gradle configuration fails.

### Workaround:
Pre-create the custom or `profile` build type in every library subproject from the root `android/build.gradle.kts` before Flutter copies it (`subprojects { pluginManager.withPlugin("com.android.library") { extensions.configure<com.android.build.api.dsl.LibraryExtension>("android") { buildTypes.maybeCreate("profile") } } }`), or for `applicationIdSuffix` set it via `androidComponents.onVariants`.

### Risk:
What is the risk level of this cherry-pick?

### Test Coverage:
Are you confident that your fix is well-tested by automated tests?

### Validation Steps:
1. Run `flutter create app && cd app && flutter pub add shared_preferences`.
2. In `android/app/build.gradle.kts`, set `applicationIdSuffix = ".profile"` on `profile` and add `create("staging") { initWith(getByName("release")) }` under `buildTypes`.
3. Run `flutter build apk --debug`, `flutter build apk --profile`, and `./gradlew -p android :app:assembleStaging`. All three succeed, and `aapt2 dump badging` on the profile APK shows package suffix `.profile`.
4. Covered by `PluginHandlerTest` and `android_plugin_example_app_build_test.dart` (verified on both AGP 9.1.1 and AGP 9.3.1).
jose-pr pushed a commit to Boriken-Dev/flutter that referenced this pull request Nov 23, 2026
…nto library plugins (#196756)

### Issue Link:
flutter/flutter#196412
and flutter/flutter#196696

Companion beta cherry-pick: flutter/flutter#196757

### Impact Description:
[#191606](flutter/flutter#191606), part of the migration to AGP's public Variant API, changed how the Flutter Gradle Plugin creates missing app build types on plugin projects. It shipped in 3.50.0 and in the current beta, 3.51.0-0.1.pre. Up to 3.47, library plugins received a compatible build type without app-only properties (#172704). Since #191606, `PluginHandler` called `initWith(appBuildType)` for every plugin. In AGP 9, `initWith` copies every build type property, and AGP rejects several of them in a library module: `applicationIdSuffix` (#196412), `isShrinkResources` (including any custom build type created with `initWith(getByName("release"))`, because Flutter enables `isShrinkResources` on `release` by default; #196696), `buildConfigFields`, and `resValues`. Because Gradle configures every build type of every subproject, affected apps fail to configure even in `debug` mode (`flutter run`). In addition, copying `isMinifyEnabled` onto library plugins caused R8 to strip plugin classes on custom minified build types (`Missing class ...Plugin`).

This cherry-pick, [#196692](flutter/flutter#196692) (`534fb4d6247`), restores separate handling for library plugins: plugins built as apps keep `initWith`, while library plugins receive only `matchingFallbacks` and `isDebuggable` (skipping app-only properties and `isMinifyEnabled`, because the app's R8 pass shrinks plugin code). It applied to `flutter-3.50-candidate.0` without conflicts (`0` diff vs `534fb4d6247`).

### Changelog Description:
[flutter/196412] When building an Android app with plugins and custom or app-only buildType settings, Gradle configuration fails.

### Workaround:
Pre-create the custom or `profile` build type in every library subproject from the root `android/build.gradle.kts` before Flutter copies it (`subprojects { pluginManager.withPlugin("com.android.library") { extensions.configure<com.android.build.api.dsl.LibraryExtension>("android") { buildTypes.maybeCreate("profile") } } }`), or for `applicationIdSuffix` set it via `androidComponents.onVariants`.

### Risk:
What is the risk level of this cherry-pick?

### Test Coverage:
Are you confident that your fix is well-tested by automated tests?

### Validation Steps:
1. Run `flutter create app && cd app && flutter pub add shared_preferences`.
2. In `android/app/build.gradle.kts`, set `applicationIdSuffix = ".profile"` on `profile` and add `create("staging") { initWith(getByName("release")) }` under `buildTypes`.
3. Run `flutter build apk --debug`, `flutter build apk --profile`, and `./gradlew -p android :app:assembleStaging`. All three succeed, and `aapt2 dump badging` on the profile APK shows package suffix `.profile`.
4. Covered by `PluginHandlerTest` and `android_plugin_example_app_build_test.dart` (verified on both AGP 9.1.1 and AGP 9.3.1).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD cp: beta cherry pick this pull request to beta release candidate branch cp: stable cherry pick this pull request to stable release candidate branch override code freeze Override an active code freeze. platform-android Android applications specifically team-android Owned by Android platform team tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

3 participants