Skip to content

[Android] add abiFilters to Flutter Gradle Plugin #168293

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Sameri11
Copy link
Contributor

@Sameri11 Sameri11 commented May 4, 2025

fixes #153476

More context in #153476 (comment) and #153476 (comment)

TLDR: abiFilters cannot be added to templates (the original issue proposes that) because it will break the Gradle build if the --splits-per-abi option is provided:

Conflicting configuration : 'armeabi-v7a,arm64-v8a,x86_64' in ndk abiFilters cannot be present when splits abi filters are set : armeabi-v7a,arm64-v8a

In this PR, abiFilters is added programmatically in the Flutter Gradle Plugin when the splits-per-abi option is not provided and only for non-debuggable builds.

As stated in #153476 (comment), abiFilters are actually useful in cases when a third-party dependency is used with the x86 variant. In other cases (such as a fresh Flutter app project), abiFilters are a bit excessive, but they do no harm.

Pre-launch Checklist

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

@github-actions github-actions bot added the tool Affects the "flutter" command-line tool. See also t: labels. label May 4, 2025
@Sameri11 Sameri11 force-pushed the android-ndk-abi-filters branch from 339f273 to 3645c87 Compare May 11, 2025 16:15
@github-actions github-actions bot added the platform-android Android applications specifically label May 11, 2025
@Sameri11 Sameri11 force-pushed the android-ndk-abi-filters branch 3 times, most recently from 0a18e48 to eaae72e Compare May 14, 2025 06:00
@Sameri11 Sameri11 changed the title [Android] add abiFilters to app templates [Android] add abiFilters to Flutter Gradle Plugin May 15, 2025
@Sameri11 Sameri11 force-pushed the android-ndk-abi-filters branch 3 times, most recently from 9525cba to 4d80540 Compare May 16, 2025 06:07
@Sameri11 Sameri11 marked this pull request as ready for review May 16, 2025 08:50
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.

LGTM, great find in #153476 (comment)!

I had suspected that abifilters were not necessary for the same reason you mentioned (that the FGP only packages the 3 ABIs it works on by default), but had not considered that the inclusion of a different native library could cause an x86 variant to get included.

@Sameri11 Sameri11 force-pushed the android-ndk-abi-filters branch from 4d80540 to 00b8ab6 Compare May 20, 2025 17:52
@Sameri11 Sameri11 force-pushed the android-ndk-abi-filters branch from 00b8ab6 to 2e82307 Compare May 20, 2025 18:27
@gmackall
Copy link
Member

Google testing seems to just not work w/ changes to the FGP, I'll override the failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform-android Android applications specifically tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flutter needs to declare abiFilters for only supported architectures by default
2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy