Search code examples
dartarmflutteraot

In flutter release mode, how native code in one snapshot run in mulity arch cpus


I've been using dart/flutter for a while, and I'm really enjoying it.

I've read that when building a mobile app, dart builds a native app with arm code. But how native code in one snapshot run in mulity arch cpus(like x86 armeabi-v7, arch64)?


Solution

  • A comment (about a year ago) that still seems to be accurate https://groups.google.com/forum/#!topic/flutter-dev/SD-gkfJQfzE

    Currently we provide pre-built --release, --profile and --debug binaries for Android 32-bit ARM and --debug binaries for Android x64 (emulators). A description of --release, etc. modes means is here: https://github.com/flutter/flutter/wiki/Flutter%27s-modes

    We have a bug on file about providing --release/--profile binaries for Android x86: https://github.com/flutter/flutter/issues/9253

    Were there other architectures you were looking for?

    It's possible to build flutter/engine yourself in various architecture / mode flavors beyond the ones we provide prebuilt for you: https://github.com/flutter/engine/blob/master/CONTRIBUTING.md

    Issue 9253 is still open, so release builds currently seem to support only 32-bit ARM

    This FAQ explanation seems to indicate that ARMv7 and ARM64 are supported https://flutter.io/faq/#what-devices-and-os-versions-does-flutter-run-on

    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.