Does every flutter app contain Flutter engine?

Viewed 289

I am trying to digest the following information from Flutter site.

How does Flutter run my code on Android?

The engine’s C and C++ code are compiled with Android’s NDK. The Dart code (both the SDK’s and yours) are ahead-of-time (AOT) compiled into native, ARM, and x86 libraries. Those libraries are included in a “runner” Android project, and the whole thing is built into an APK. When launched, the app loads the Flutter library. Any rendering, input, or event handling, and so on, is delegated to the compiled Flutter and app code. This is similar to the way many game engines work.

Is each Flutter app (more precisely each Android app that is created with Flutter) published with Flutter engine attached?

2 Answers

Yes, it is included in every app. There is no code sharing between apps on Android/iOS. Also each app could have a different version of the engine (depending on when it was compiled)

Note that the with the upcoming Flutter 1.0, the overhead (on Android) is less than 5M, which is not bad. I believe the overhead is similar on iOS.

libflutter.so is 27.1MB on my emulator for each of a full / production app and a hello world app.

Related