Skip to content

Flutter needs to declare abiFilters for only supported architectures by default #153476

@lukehutch

Description

@lukehutch

Steps to reproduce

Flutter does not set abiFilters in its default flutter create template, which means that without intervention, apps published to the Play Store all declare that they will run on x86 (x86_32), which is not (and never will be) supported by Flutter.

Users with x86 devices who install the app from Google Play will be met with a crash, which is logged in Crashlytics as java.lang.UnsatisfiedLinkError: dlopen failed: library "libflutter.so" not found.

This issue is forked from #151638 at the request of @danagbemava-nc, who said:

It appears there was an attempt to add this in #135529 but it was later reverted in #142089 and it must have dropped off everyone's radar. Can you file a new proposal for adding it?

Expected results

Flutter should opt-in to all of its supported architectures by default using ndk.abiFilters.

Actual results

Failing to set abiFilters means that the app can run on all architectures supported on Google Play, which simply does not reflect reality.

Code sample

Code sample

android/app/build.gradle should include something like this when flutter create is called:

android {
    defaultConfig {
        ndk.abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86_64'
    }
}

Screenshots or Video

N/A

Logs

N/A

Flutter Doctor output

Doctor output
$ flutter doctor -v
[✓] Flutter (Channel beta, 3.24.0-0.2.pre, on Fedora Linux 40 (Workstation Edition) 6.10.3-200.fc40.x86_64, locale en_US.utf8)
    • Flutter version 3.24.0-0.2.pre on channel beta at /opt/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 7c6b7e9ca4 (2 weeks ago), 2024-07-30 14:26:44 +0700
    • Engine revision 6e4deceb38
    • Dart version 3.5.0 (build 3.5.0-323.2.beta)
    • DevTools version 2.37.2

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /home/luke/Android/Sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: /opt/android-studio/jbr/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop
    • clang version 18.1.6 (Fedora 18.1.6-3.fc40)
    • cmake version 3.28.2
    • ninja version 1.12.1
    • pkg-config version 2.1.1

[✓] Android Studio (version 2023.3)
    • Android Studio at /opt/android-studio
    • Flutter plugin version 79.0.2
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160)

[✓] VS Code (version 1.92.1)
    • VS Code at /usr/share/code
    • Flutter extension version 3.95.20240801

[✓] VS Code (version 1.93.0-insider)
    • VS Code at /usr/share/code-insiders
    • Flutter extension version 3.91.20240529

[✓] Connected device (2 available)
    • Linux (desktop) • linux  • linux-x64      • Fedora Linux 40 (Workstation Edition) 6.10.3-200.fc40.x86_64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 127.0.6533.119

[✓] Network resources
    • All expected network resources are available.

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: proposalA detailed proposal for a change to Flutterplatform-androidAndroid applications specificallyr: fixedIssue is closed as already fixed in a newer versionteam-androidOwned by Android platform teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-androidTriaged by Android platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions