-
Notifications
You must be signed in to change notification settings - Fork 128
Building Flutter apps
See also: Desktop support for Flutter
$ git clone https://github.com/flutter/flutter
$ sudo mv flutter /opt/
$ export PATH=$PATH:/opt/flutter/bin
$ flutter config --enable-linux-desktop
$ flutter doctor
Please note that you must use the same version (channel) that you built Flutter embedder for. I recommend that you use the latest version of the master channel for both the SDK and Flutter Engine. See also: Building Flutter Engine embedder
Here introduce how to build the flutter sample app.
Note that you need to build Flutter apps in the same mode(release/debug) libflutter_engine.so
was built. It means you need to build Flutter apps in the release mode if you use libflutter_engine.so
was built in release mode.
Build for release mode:
$ flutter create sample
$ cd sample/$ cd sample/
$ flutter build linux
$ cd ..
Build for debug mode:
$ flutter build linux --debug
Comming soon. We are contributing to support this now. See: https://github.com/flutter/flutter/issues/74929
If you want to work Flutter apps in debug mode, you can also do the following steps on both x64 and arm64 hosts. In debug mode, the Flutter bundle artifacts are not architecturally different between x64 and arm64.
$ flutter build bundle --asset-dir=./bundle/data/flutter_assets
$ cp <path_to_flutter_sdk_install>/bin/cache/artifacts/engine/linux-*/icudtl.dat ./bundle/data