How to optimize the Flutter App size?

非 Y 不嫁゛ 提交于 2019-12-11 08:44:48

问题


I am a native Android developer and I started using flutter SDK. I developed a simple app by following official flutter doc. But I found that the debug app size is 46 MB which is too large for this simple app. Is there any way to optimize the app size? because Flutter app size is larger than the native Android App.


回答1:


Flutter debug app is very big, to optimize the app you should build it as release version by using

flutter build apk (flutter build defaults to --release).

Preparing an Android App for Release

Preparing an iOS App for Release




回答2:


TO REDUCE APK SIZE:

If you are building android apk or bundle, then make sure you are considering

Minify

Proguard

Some common things to keep in mind

clean codes

remove unused plugins

remove unused assets

remove unused fonts etc.




回答3:


Try this,

flutter build apk --split-per-abi


来源:https://stackoverflow.com/questions/49567065/how-to-optimize-the-flutter-app-size

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!