Flutter的最终APK版本中未包含的某些软件包 [英] Some Package not included in final APK build in Flutter
问题描述
我制作了一个简单的测试应用程序,在Flutter中显示Hello World!
.我使用了GoogleFonts
包来更改fontFamily
.当我在Android Studio中运行它时,一切正常.但是在最终版本中,样式已还原为默认的Roboto
.当我使用Android Studio的分析APK"功能时,我发现GoogleFonts
包未包含在最终版本中.可能是什么问题呢?这是错误还是我做错了?
我从未使用过Android Studio的APK分析器来处理Flutter APK,但是当我分析能正常工作的Flutter APK时,我发现包含libflutter.so和libapp.so. Flutter的结构肯定不同于常规的Android APK.这些程序包包含在libapp.so中,没有像在本机Android APK中一样作为单独的库添加.
澄清一下:在本机Android APK上,您将看到APK在Flutter APK上使用的外部库,而您将看不到外部flutter库,它们似乎包含在libapp.so和/或libflutter.so中. /p>
I have made a simple test app that displays Hello World!
in Flutter. I used GoogleFonts
package to change fontFamily
. When I run it in Android Studio, everything works fine. But in the final build, the styling was reverted back to default Roboto
. When I used Android Studio's 'Analyze APK' feature, I found out that GoogleFonts
package was not included in the final build. What could be the problem? Is this a bug, or am I doing it wrong?
I have never used the APK Analyzer from Android studio for Flutter APK's, but when I analyze a properly working flutter APK, I see that the includes libflutter.so and libapp.so. The structure of a Flutter is certainly different from a regular Android APK. The packages are included in libapp.so and not added as separate libraries like they are in native Android APKs.
To clarify: on native Android APKs you will see the external libraries that the APK is using on Flutter APKs you will not see the external flutter libraries, they seem to be included in libapp.so and/or libflutter.so.
这篇关于Flutter的最终APK版本中未包含的某些软件包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!