Skip to content

Conversation

@mboetger
Copy link
Contributor

@mboetger mboetger commented Oct 29, 2025

This PR introduces a flag (disable-abi-filtering) that disables the FlutterPlugin's abiFiltering on buildTypes. This should only be used when the developers know what they are doing. Specifically this allows developers to set their own abiFilters in ProductFlavors or defaultConfig.

Because Gradle has complex merging logic, there is a hierarchy of priority when calculating settings (like abiFilters). For example: defaultConfig < productFlavors < buildTypes when combining the three into the final build variant. If abiFilters are set in buildType, it will override abiFilters in productFlavors.

When the FlutterPlugin executes, it cannot know about the developers build.gradle settings and therefore we cannot add logic that checks to see if abiFilters are set in productFlavors. Therefore, this flag gives developers an escape hatch so they can implement what they want.

Fixes: #175845

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].
  • I followed the [breaking change policy] and added [Data Driven Fixes] where supported.
  • All existing and new tests are passing.

@github-actions github-actions bot added tool Affects the "flutter" command-line tool. See also t: labels. team-android Owned by Android platform team labels Oct 29, 2025
@mboetger
Copy link
Contributor Author

@gmackall - this unit test repros: #175845

It seems like we still need to add the abiFilters for our platform architectures (so not sure #177745 is going work), but product flavors are not being respected when we do.

@github-actions github-actions bot added the platform-android Android applications specifically label Nov 6, 2025
@mboetger mboetger changed the title Respect product flavor abiFilters Respect product flavor abiFilters by adding a disable-abi-filtering Android project flag. Nov 6, 2025
@mboetger mboetger marked this pull request as ready for review November 6, 2025 17:32
@mboetger mboetger requested a review from a team as a code owner November 6, 2025 17:32
@mboetger mboetger requested a review from gmackall November 6, 2025 17:33
Copy link
Member

@gmackall gmackall left a comment

Choose a reason for hiding this comment

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

I think to truly mark the linked issue as fixed we would also need to expose this option through the flutter tool, something like the path that android-skip-build-dependency-validation takes in #143341

@mboetger
Copy link
Contributor Author

mboetger commented Nov 6, 2025

I think to truly mark the linked issue as fixed we would also need to expose this option through the flutter tool, something like the path that android-skip-build-dependency-validation takes in #143341

Technically it can be invoked by the flutter tool though, no? This is the test invocation I used:

flutter build apk --release --flavor arm64 -Pdisable-abi-filtering=true

I thought about adding at flutter level command line, but since this is such a niche use case and should only be used at the developers peril I didn't want to make it too easy for developers to find the escape hatch. I was going to add some documentation on https://docs.flutter.dev/release/breaking-changes/default-abi-filters-android but I was concerned adding a flutter level flag would invite users to try it out.

Anyway, that's my 2 cents. If it's a blocker to LGTM I'll add it.

@gmackall
Copy link
Member

gmackall commented Nov 6, 2025

I think to truly mark the linked issue as fixed we would also need to expose this option through the flutter tool, something like the path that android-skip-build-dependency-validation takes in #143341

Technically it can be invoked by the flutter tool though, no? This is the test invocation I used:

flutter build apk --release --flavor arm64 -Pdisable-abi-filtering=true

I thought about adding at flutter level command line, but since this is such a niche use case and should only be used at the developers peril I didn't want to make it too easy for developers to find the escape hatch. I was going to add some documentation on https://docs.flutter.dev/release/breaking-changes/default-abi-filters-android but I was concerned adding a flutter level flag would invite users to try it out.

Anyway, that's my 2 cents. If it's a blocker to LGTM I'll add it.

Ah I had forgotten about the -android-project-arg/-P command. That's fair, I actually prefer passing it that way as well.

Maybe we should add something to our flavors docs which makes brief mention of this requirement when using abiFilters on the product flavors though? Otherwise I think there is essentially no way for a developer to know to do this outside of either us telling them directly on an issue, or them knowing the internals of the FGP (which I think we should never assume they do).

Copy link
Member

@gmackall gmackall left a comment

Choose a reason for hiding this comment

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

That additional documentation can be figured out independently though, this change lgtm

@mboetger mboetger added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 6, 2025
@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Nov 6, 2025
@auto-submit
Copy link
Contributor

auto-submit bot commented Nov 6, 2025

auto label is removed for flutter/flutter/177753, Failed to enqueue flutter/flutter/177753 with HTTP 400: GraphQL mutate failed.

@mboetger mboetger added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 6, 2025
@auto-submit auto-submit bot added this pull request to the merge queue Nov 6, 2025
@jtmcdole
Copy link
Member

jtmcdole commented Nov 6, 2025

This was stuck in the merge queue and not progressing; removing and re-inserting.

@jtmcdole jtmcdole removed this pull request from the merge queue due to a manual request Nov 6, 2025
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Nov 6, 2025
@jtmcdole jtmcdole added this pull request to the merge queue Nov 6, 2025
@mboetger
Copy link
Contributor Author

mboetger commented Nov 6, 2025

This was stuck in the merge queue and not progressing; removing and re-inserting.

Did you try turning the computer off and then back on again? /s

Merged via the queue into flutter:master with commit 767fac1 Nov 7, 2025
149 of 150 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 7, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 7, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 7, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 8, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 9, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 9, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 11, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 11, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 11, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 12, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 12, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 12, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 12, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 12, 2025
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Nov 12, 2025
…10408)

Manual roll requested by [email protected]

flutter/flutter@31a8481...ee23168

2025-11-07 [email protected] Roll Packages from f13bad3 to 3caa48b (5 revisions) (flutter/flutter#178164)
2025-11-07 [email protected] Fix text input actions in DropdownMenu. (flutter/flutter#177313)
2025-11-07 [email protected] Roll Skia from f838c4b31edb to 581d1ecd5029 (1 revision) (flutter/flutter#178157)
2025-11-07 [email protected] Roll Skia from eb3c5b280ae6 to f838c4b31edb (3 revisions) (flutter/flutter#178149)
2025-11-07 [email protected] Roll Skia from 360fe72b5bf4 to eb3c5b280ae6 (1 revision) (flutter/flutter#178147)
2025-11-07 [email protected] Roll Skia from 116f237bb39d to 360fe72b5bf4 (4 revisions) (flutter/flutter#178146)
2025-11-07 [email protected] Roll Fuchsia Linux SDK from cm88aTLui5yorSGYQ... to qDVe2mrpSgQdxra7p... (flutter/flutter#178144)
2025-11-07 [email protected] fix: findChildIndexCallback to take seperators into account for seperated named constructor in ListView and SliverList (flutter/flutter#174491)
2025-11-06 [email protected] [web] Remove unnecessary android_sdk dep (flutter/flutter#178078)
2025-11-06 [email protected] Add haptic notifications support. (flutter/flutter#177721)
2025-11-06 [email protected] Allow label to be used to compute InputDecorator Intrinsic width (flutter/flutter#178101)
2025-11-06 [email protected] Respect product flavor abiFilters by adding a `disable-abi-filtering` Android project flag. (flutter/flutter#177753)
2025-11-06 [email protected] Use aria-hidden attribute for platform view accessibility on web (flutter/flutter#177969)
2025-11-06 [email protected] [tool] Fix IP parsing by using Uri constructor (flutter/flutter#178083)

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
sfshaza2 pushed a commit to flutter/website that referenced this pull request Nov 13, 2025
A new flag has been added that will allow Android developers to disable
FlutterPlugin.kt code that adds abiFilters to buildTypes. This should
only be used when the developer knows what they are doing. This is
specifically for developers that want to set abiFilters in [Product
Flavors](flutter/flutter#175845)

Depends on: flutter/flutter#177753

## Presubmit checklist

- [X] If you are unwilling, or unable, to sign the CLA, even for a
_tiny_, one-word PR, please file an issue instead of a PR.
- [X] If this PR is not meant to land until a future stable release,
mark it as draft with an explanation.
- [X] This PR follows the [Google Developer Documentation Style
Guidelines](https://developers.google.com/style)—for example, it doesn't
use _i.e._ or _e.g._, and it avoids _I_ and _we_ (first-person
pronouns).
- [X] This PR uses [semantic line
breaks](https://github.com/dart-lang/site-shared/blob/main/doc/writing-for-dart-and-flutter-websites.md#semantic-line-breaks)
  of 80 characters or fewer.
IvoneDjaja pushed a commit to IvoneDjaja/flutter that referenced this pull request Nov 22, 2025
… Android project flag. (flutter#177753)

This PR introduces a flag (`disable-abi-filtering`) that disables the
FlutterPlugin's abiFiltering on buildTypes. This should only be used
when the developers know what they are doing. Specifically this allows
developers to set their own abiFilters in ProductFlavors or
defaultConfig.

Because Gradle has complex merging logic, there is a hierarchy of
priority when calculating settings (like abiFilters). For example:
defaultConfig < productFlavors < buildTypes when combining the three
into the final build variant. If abiFilters are set in buildType, it
will override abiFilters in productFlavors.

When the FlutterPlugin executes, it cannot know about the developers
build.gradle settings and therefore we cannot add logic that checks to
see if abiFilters are set in productFlavors. Therefore, this flag gives
developers an escape hatch so they can implement what they want.

Fixes: flutter#175845 

## 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.
- [X] I updated/added relevant documentation (doc comments with `///`).
- [X] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [X] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [X] All existing and new tests are passing.
reidbaker pushed a commit to AbdeMohlbi/flutter that referenced this pull request Dec 10, 2025
… Android project flag. (flutter#177753)

This PR introduces a flag (`disable-abi-filtering`) that disables the
FlutterPlugin's abiFiltering on buildTypes. This should only be used
when the developers know what they are doing. Specifically this allows
developers to set their own abiFilters in ProductFlavors or
defaultConfig.

Because Gradle has complex merging logic, there is a hierarchy of
priority when calculating settings (like abiFilters). For example:
defaultConfig < productFlavors < buildTypes when combining the three
into the final build variant. If abiFilters are set in buildType, it
will override abiFilters in productFlavors.

When the FlutterPlugin executes, it cannot know about the developers
build.gradle settings and therefore we cannot add logic that checks to
see if abiFilters are set in productFlavors. Therefore, this flag gives
developers an escape hatch so they can implement what they want.

Fixes: flutter#175845 

## 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.
- [X] I updated/added relevant documentation (doc comments with `///`).
- [X] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [X] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [X] All existing and new tests are passing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Development

Successfully merging this pull request may close these issues.

[Android] reconfigure abiFilters not effect in productFlavors abiFilters

3 participants