我找不到任何具体资源,Dart是否已编译为JVM,还是Google的团队将Dart VM编译为在JVM上运行,然后在JVM内的Dart VM中运行Dart?
前者更有意义,并且与“ no brIDge”的口头禅相呼应,但后者似乎更符合how integration between native & flutter code looks like的要求.
解决方法:
Dart被编译为本机代码(ARM,Intel等)可执行文件,并与某些本机平台代码(Java,Kotlin,Objective-C / Swift)捆绑在一起,以与本机平台进行交互.
也可以看看
How does Flutter run my code on AndroID? The engine’s C and C++ codeare compiled with AndroID’s NDK. The Dart code (both the SDK’s and
yours) are ahead-of-time (AOT) compiled into a native, ARM library.
That library is 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, are
delegated to the compiled Flutter and app code. This is similar to the
way many game engines work.DeBUG mode builds use a virtual machine (VM) to run Dart code (hence
How does Flutter run my code on iOS? The engine’s C and C++ code are
the “deBUG” banner they show to remind people that they’re slightly
slower) in order to enable stateful hot reload.compiled with LLVM. The Dart code (both the SDK’s and yours) are
ahead-of-time (AOT) compiled into a native, ARM library. That library
is included in a “runner” iOS project, and the whole thing is built
into an .ipa. When launched, the app loads the Flutter library. Any
rendering, input or event handling, and so on, are delegated to the
compiled Flutter and app code. This is similar to the way many game
engines work.DeBUG mode builds use a virtual machine (VM) to run Dart code (hence
the “deBUG” banner they show to remind people that they’re slightly
slower) in order to enable stateful hot reload.
https://flutter.io/docs/resources/faq#how-does-flutter-run-my-code-on-android
另请参见https://proandroiddev.com/flutters-compilation-patterns-24e139d14177
总结以上是内存溢出为你收集整理的Dart / Flutter如何编译为Android?全部内容,希望文章能够帮你解决Dart / Flutter如何编译为Android?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)