Building a release version of flutter engine.

365 views
Skip to first unread message

Daniel Zduniak

unread,
Apr 26, 2020, 7:25:05 AM4/26/20
to Flutter Development (flutter-dev)
I'm currently trying to fix some specific issue in my app that requires me to modify flutter's engine source code...

I've managed to build it from source and it works fine for debugging purposes... but eventually I would like to build a release apk file of my app using my custom engine and currently doing this with flutter tool is somewhat cumbersome. To build a release version I would have to use a command like:

flutter build apk --release --target-platform=android-arm64 --local-engine-src-path /path/to/engine/src --local-engine=android_release_arm64

Also I don't think it is possible to build an apk containing binaries for various platforms since "--local-engine" parameter value has to be different for different targets.

There is also an issue of disk space since custom engine folder contains various debugging info files that amount to about 50 GB of data (compared to ~2GB of release version of flutter you can download from Google) and I would like to quickly move my engine build around different computers.

Would it be possible to replace some files in my regular flutter install with files from my custom engine so I could build a release version simply using "flutter build --release" command?

Which files would I need to move and where?

Adeola

unread,
Jul 17, 2020, 1:33:20 AM7/17/20
to Flutter Development (flutter-dev)
I have changed one or two files in order to get a custom build of the engine, to fix issues, just like you said. As far as I know the default build used by flutter which is not so large has already been compiled for its respective flutter version.

Meaning that a stable version of flutter, for example 1.17.0 has its own compiled stable version of its engine. That is why when running "flutter upgrade", the compiled version is downloaded and this has little to know storage problems. I don't think you can change the files since its has already been compiled, sadly.

Hope that helps and if it's not to much to ask, I also have faced problems when building for iOS using a custom flutter engine. I usually run this command " flutter run --release --local-engine-src-path /path/to/engine/src --local-engine=ios_release" . I get an error saying gen_snapshot_arm64 was not found. Any idea of what this means ?
Reply all
Reply to author
Forward
0 new messages