Skip to content

Add the ability to build fat APKs with flutter build #6864

Closed

Description

@Pacane

Right now, the APK built with flutter build apk doesn't work on an android emulator.

After talking to @eseidelGoogle on gitter, he asked me to open an issue:

@Pacane I think having the ability to build fat apks using flutter build is a very reasonable request. Would you mind filing a bug?

Note: The reason was that I was sending the built .apk to my tester, lacking a better workflow, and it didn't work.

 ❯ flutter install                                                                                                                                                                                                       [12:49:10]
Installing app.apk to Android SDK built for x86 64...
Installing build/app.apk...                              
Failed to install build/app.apk: Failure [INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-113]

Oops; flutter has exited unexpectedly: "Exit code 1 from: /opt/android-sdk/platform-tools/adb -s emulator-5554 install -r build/app.apk".
Crash report written to /home/joel/code/dart/catalogue-mouches/flutter_03.log;
please let us know at https://github.com/flutter/flutter/issues.

Activity

  1. eseidelGoogle commented on Nov 15, 2016

    @eseidelGoogle
    Contributor

    So it is possible to build an apk for a simulator with flutter build apk --target-arch=x86, but we don't currently have the ability to bundle more than one arch in a single apk from that command.

  2. Pacane commented on Nov 15, 2016

    @Pacane
    ContributorAuthor

    @eseidelGoogle Though I have just tried it, and received this:

     ❯ flutter build apk --target-arch=x86                                                         [13:28:12]
    Profile and release builds are only supported on ARM targets.
    

    I have just upgraded Flutter too.

  3. eseidelGoogle commented on Nov 15, 2016

    @eseidelGoogle
    Contributor

    @Pacane that's true, you'd have to pass --debug --target-arch=x86. :/ So it's possible that fat APKs don't actually make sense at least x86 vs. arm. Maybe arm and arm64.

  4. Pacane commented on Nov 15, 2016

    @Pacane
    ContributorAuthor

    Gotcha, works fine, thanks!

  5. eseidelGoogle commented on Jan 19, 2017

    @eseidelGoogle
    Contributor

    This might get fixed as part of moving flutter build onto gradel. FYI @mit-mit

  6. mit-mit commented on Jan 20, 2017

    @mit-mit
    Member

    @jakobr-google, also covered?

  7. jakobr-google commented on Jan 20, 2017

    @jakobr-google
    Contributor

    Yep. We are actually building a fat APK right now, we just only include native binaries for ARM... It'll be fixed as part of my work.

    I'm leaning towards having split APKs as the default, to keep APK size down, but we can discuss this separately.

  8. added a commit that references this issue on Jan 24, 2017
    f4d1f43
  9. added a commit that references this issue on Jan 31, 2017
    a0f0c42
  10. github-actions commented on Sep 5, 2021

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  11. locked as resolved and limited conversation to collaborators on Sep 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions