Skip to content

Provide x86 (32 and 64-bit?) Android Release binaries #9253

Closed

Description

@eseidelGoogle

Internal: b/139750633

We learned in #2898 that Android x86 accounts for over 1% of Android devices, that's over a million devices.

This bug tracks doing so.

EDIT: See @rmacnak-google comments below. Implementing x86 Android Ahead of Time (AOT) compiled binaries will require a substantial amount of work in the Dart compiler. We could however implement JIT-based --release binaries for x86 with some minor plumbing work if needed.

Activity

  1. added this to the milestone on Apr 6, 2017
  2. eseidelGoogle commented on Apr 6, 2017

    @eseidelGoogle
    ContributorAuthor

    See also #2089 which is a similar bug for iOS about providing more flavors of pre-built binaries.

  3. eseidelGoogle commented on Apr 6, 2017

    @eseidelGoogle
    ContributorAuthor

    @rmacnak-google Are there any Dart limitations to supporting x86 Android Release binaries (i.e. does AOT work)? If so could you please link to such bugs?

  4. eseidelGoogle commented on Apr 6, 2017

    @eseidelGoogle
    ContributorAuthor

    Assuming no Dart limitations, it should be possible to work around us not currently providing these pre-built binaries by building the flutter engine yourself and using the --local-engine option to flutter:
    https://github.com/flutter/engine/blob/master/CONTRIBUTING.md

  5. rmacnak-google commented on Apr 6, 2017

    @rmacnak-google
    Contributor

    The Dart VM does not support AOT compilation for x86. AOT is supported for x64, ARM, ARM64 and MIPS.

    (When targeting x86, we reference constants directly from instructions, but on all other architectures we load them through a constant pool, which allows us to handle their relocation. It is possible to do this on x86 as well, but it is a substantial change.)

    The VM does support disabling the vm-service, etc for the JIT just as it does for AOT, so it would be possible to build a release version of the engine for x86 that uses the JIT.

  6. danilNikolaenko1990 commented on Jun 12, 2017

    @danilNikolaenko1990

    when I tried to launch demo application I got the message
    Profile and release builds are only supported on ARM targets.
    Error running application on ASUS T00J.
    It is very sadly that flutter is not for x86, because there are many devices on Intel atom.

  7. modified the milestones: 3: Current Milestone, on Sep 28, 2017
  8. eseidelGoogle commented on Sep 28, 2017

    @eseidelGoogle
    ContributorAuthor

    Given the amount of work in the Dart VM, I suspect this is more realistically M4 than M3.

  9. refi64 commented on Oct 15, 2017

    @refi64

    So, in the mean time I've been distributing a debug APK...not fun!

    I've built Flutter manually in x86 release mode, but when I try to build the app it crashes saying precompilation isn't supported.

    Is there a way to make a release build of Flutter with precompilation disabled?

  10. refi64 commented on Nov 2, 2017

    @refi64

    So I managed to build it for X86 in release mode with AOT disabled using this patch:

    diff --git a/shell/platform/android/BUILD.gn b/shell/platform/android/BUILD.gn
    index 517b2a5e4..8800a4450 100644
    --- a/shell/platform/android/BUILD.gn
    +++ b/shell/platform/android/BUILD.gn
    @@ -47,11 +47,11 @@ shared_library("flutter_shell_native") {
         "//garnet/public/lib/fxl",
         "//third_party/skia",
       ]
    -  if (flutter_runtime_mode == "debug") {
    +  # if (flutter_runtime_mode == "debug") {
         deps += [ "//dart/runtime:libdart_jit" ]
    -  } else {
    -    deps += [ "//dart/runtime:libdart_precompiled_runtime" ]
    -  }
    +  # } else {
    +    # deps += [ "//dart/runtime:libdart_precompiled_runtime" ]
    +  # }
     
       public_configs = [
         "$flutter_root:config",
    diff --git a/tools/gn b/tools/gn
    index fded2b0c2..30f3729d6 100755
    --- a/tools/gn
    +++ b/tools/gn
    @@ -97,6 +97,7 @@ def to_gn_args(args):
               aot = True
         else:
           aot = False
    +    aot = False
     
         if args.runtime_mode == 'debug':
             gn_args['dart_runtime_mode'] = 'develop'

    Except, someone tried it, and it's stuck on a black screen. The logcat doesn't mention anything wrong. Is this even possible right now? 😐

  11. rock3r commented on Jan 17, 2018

    @rock3r
    Contributor

    Just to chime in to this, I've just had this issue where I needed to ship a new Android build ASAP for a certain app while I was out and about, and I didn't have a USB cable to connect my phone to my computer to smoke test the build. I was counting on being able to use the Android emulator but I found out about this limitation. It was a painful moment but I managed to get a cable from someone and test the build; had I not been at an Android meetup I'd have had some issues, though.

    I think it's quite important to get to support Android release builds on emulators. I did not expect this limitation to be there, and I imagine most other devs wouldn't either. It's not a small issue
    either in normal flows — why should I not be able to run my app on an emulator? What if I need to run screenshot tests on a CI without physical emulators? Or maybe auto-generate screenshots for the store listing, or any other number of legit workflows in which one needs to be able to install a release build on to an emulator.

  12. mit-mit commented on Mar 6, 2018

    @mit-mit
    Member

    Note: when this is eventually fixed, make sure to update the FAQ: https://github.com/flutter/website/pull/856/files

  13. 86 remaining items

  14. jonahwilliams commented on Nov 7, 2019

    @jonahwilliams
    Contributor

    @Matt1700 please file a bug with details on how you built it and your flutter version

  15. Matt1700 commented on Nov 8, 2019

    @Matt1700

    @jonahwilliams here's the issue #44425

  16. apecoraro commented on Feb 13, 2020

    @apecoraro

    I went through the steps described here: https://github.com/flutter/flutter/wiki/JIT-Release-Modes to build an x86 jit-release build. However, now I seem to be stuck on the step of figuring out how to use x86 jit-release build in my Flutter app. The instructions in the linked document talk about using the "flutter assemble" command, but there isn't much documentation that I can find on how to use that command. Any help with that?

  17. tarek360 commented on Apr 16, 2020

    @tarek360

    @eseidel @Hixie @chinmaygarde @mit-mit
    Do we need to update FAQs and remove this note? 👇

    Note Flutter currently does not support building for x86 Android (issue #9253) directly, however apps built for ARMv7 or ARM64 run fine (via ARM emulation) on many x86 Android devices.

  18. tarek360 commented on Apr 17, 2020

    @tarek360

    @apecoraro have you found a way to do it?

  19. apecoraro commented on Apr 17, 2020

    @apecoraro

    @tarek360 nope, I eventually gave up because I found that the ARM emulation mode worked fine, at least on the Chromebook.

  20. magicleon94 commented on Apr 29, 2020

    @magicleon94

    Any idea on when this is going to hit the stable channel?

  21. Robert3141 commented on May 5, 2020

    @Robert3141

    If this is now supported please update the FAQ

  22. mit-mit commented on May 5, 2020

    @mit-mit
    Member

    Logged flutter/website#4039 for the FAQ issue

  23. kw2019ltd commented on May 10, 2020

    @kw2019ltd

    still not supported
    flutter build apk --target-platform android-x86 is failing

    FAILURE: Build failed with an exception.

    • What went wrong:
      Could not determine the dependencies of task ':app:compileReleaseJavaWithJavac'.

    Could not resolve all task dependencies for configuration ':app:releaseCompileClasspath'.
    Could not find io.flutter:x86_release:1.0.0-540786dd51f112885a89792d678296b95e6622e5.
    Required by:
    project :app

    • Try:
      Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

    • Get more help at https://help.gradle.org

    BUILD FAILED in 1m 5s
    Running Gradle task 'assembleRelease'...
    Running Gradle task 'assembleRelease'... Done 66.6s
    Gradle task assembleRelease failed with exit code 1

  24. gregko commented on Jun 21, 2020

    @gregko

    It's a shame that x86 (32 and 64-bit flavors) are not fully supported by Flatter on Android. Intel processor support is now more important than ever - my apps for example are used not only on Android phones and tablets, but also on Chromebooks, many of which have Intel processors, or under emulators (BlueStacks, NoxPlayer and others) on computers. x86 flavors installs of Android apps are on the rise constantly, at least in my experience. Please reconsider this strange policy decision.

  25. duytq94 commented on Jul 29, 2020

    @duytq94

    Flutter haven't support AOT for x86 (32 bit) yet, but the app was built without this architecture still work fine because each Android x86 device has an "ARM emulation".
    You can see image below (Asus zenfone 2), the CPU architecture is x86, but this device has an "ARM emulation" so the Instructions Sets also include armeabi-v7a which will help you run arm apps.
    FlutterOnZenfone (3)

  26. github-actions commented on Aug 1, 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.

  27. locked as resolved and limited conversation to collaborators on Aug 1, 2021
  28. added a commit that references this issue on Jul 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

c: contributor-productivityTeam-specific productivity, code health, technical debt.c: new featureNothing broken; request for a new capabilitycustomer: money (g3)dependency: dartDart team may need to help usengineflutter/engine related. See also e: labels.platform-androidAndroid applications specificallyplatform-chromebookChromebook applications specificallytoolAffects the "flutter" command-line tool. See also t: labels.

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions