问题
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