Reputation: 195
I have created an IOS build for flutter for the app store and generated its archive which resulted in a huge 90 MB .ipa file. I searched a lot on the net that how can I reduce IPA file size but didn't got any suitable answers. I tried several methods like :
Does switching my Xcode project from Swift to Objective-C will reduce my .ipa file size? I am using several third party libraries in my Flutter app, are they responsible for this huge size?
cupertino_icons: ^0.1.2
gradient_app_bar: ^0.1.3
url_launcher: ^5.1.2
easy_localization: ^1.3.0+1
http: ^0.12.0+2
connectivity: ^0.4.4
fluttertoast: ^3.1.3
carousel_slider: ^1.3.0
image_picker: ^0.6.1+4
flutter_barcode_scanner: ^0.1.5+1
Upvotes: 11
Views: 3792
Reputation: 374
iOS
Create an Xcode App Size Report.
First, by configuring the app version and build as described in the iOS create build archive instructions.
Then:
Sign and export the IPA.
The exported directory contains App Thinning Size Report.txt with details about your projected application size on different devices and versions of iOS.
You may also try:
flutter clean
flutter pub get
Then:
For iOS:
flutter build ios --analyze-size
flutter build ipa
Using --split-debug-info flag can dramatically reduce code size. For an example of using this flag, see Obfuscating Dart code.
Upvotes: 1
Reputation: 163
Late, but still, even when i tried
flutter build ipa
command, ipa file generated is around 90mb
So i tried creating archive with xcode, select Distribution and continue, and export the file it create.. ipa file was around 14 mb.
Upvotes: 1
Reputation: 245
As of Flutter 1.17
you will find a 20% app size reduction,
Also Obfuscating you code will decrease your app size https://flutter.dev/docs/deployment/obfuscate
Tip! in flutter 1.17 they improves app performance by 50% on iOS
Upvotes: 2
Reputation: 131
Did you try using --split-debug-info=
at the end of your build command?
Upvotes: 3