Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter huge app size in iOS compared with React Native original

Tags:

flutter

I've recreated a simple app that was originally made in React Native with 5MB file size on the app store. The app has no images or anything of any particular size, but it does use Admob ads.

After uploading it to the app store the build is showing as 35MB...not sure what the reason is but it when opening the package contents of the build archive it seems that a bunch of dylib files in SwiftSupport/iphoneos are created that are very large. that's the biggest folder in the archive anyway. I think it has to do with the Pods folder created in order to use Admob.

I'm guessing it can never be as small as the React Native original app but surely it should not be seven times the size...is there some way to remove the SwiftSupport files or another way to shrink it?

EDIT: Also in the Runner project folder in the build archive in Frameworks there are loads of Swift dylib files in there too that are large. Really all the space is being taken up by these Swift support dylib files...

Just built the app for Android and it's 8.33MB so quite a difference there, even though both versions of course use Admob.

like image 494
Hasen Avatar asked Jul 15 '19 02:07

Hasen


People also ask

Why are the size of Flutter apps so big?

You should be aware that a flutter app contains the whole runtime, so there is no dependency of a specific Android SDK version (except for plugins), therefore bigger size is inevitable. Flutter is not even 1.0. The Flutter team is aware of the size and mentioned that they'll address that later.

Is Flutter better than React Native in 2022?

In general terms, for larger applications that require native programming, Flutter is the most suitable option. On the other hand, react Native adapts well to applications that can develop from plug-and-play modules. React Native may be a more sensible choice if you already have a team of skilled JS developers.

Is Flutter really better than React Native?

Flutter is much more developer-friendly than React Native. Dart as a programming language is easier to work with and understand than JavaScript. Dart is also closer (in paradigms and usage) to programming languages used in native mobile app development.

Is Flutter better than native iOS?

If we are to compare native development vs Flutter, both provide high scalability and quality user experience. But creating your app with Flutter is faster, and the development process will be easier as you need fewer developers, and it will take fewer hours of their work.


1 Answers

This isn't really related to Flutter. Every iOS app containing code that wants to support iOS 11 and lower, needs to contain additional flutter libraries.

You can disable this in Xcode by setting "Always Embed Swift Standard Libraries" to false, and raising the deployment target to iOS 12.

Example of my flutter app with respect to different deployment targets. There is no change in build setting but deployment target only. iOS 13 does not include swift libraries with the build.

iOS version -> App build size 
10 -> 127.8 MB
11 -> 127.8 MB
12 -> 90.9 MB 
13 -> 49.6 MB
like image 70
szotp Avatar answered Sep 22 '22 18:09

szotp