Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase CocoaPods are too large (70mb)

I have finished writing an IOS app and I used Firebase Database, auth, instance, messaging and core modules.

when I archived the app for deployment the size of the IPA file was 110mbs.

I checked my project files. the main project file including all assets is around 4mb, but the pods file is 67mb in size. does that get compressed ? or how do I reduce its size ?

this is the content of my podfile:

pod 'Firebase'
pod 'Firebase/Core'
pod 'Firebase/Auth'
pod 'Firebase/Database'
pod 'Firebase/Storage'
pod 'Firebase/Messaging'

thanks

like image 740
K.A.Q Avatar asked Jan 20 '18 18:01

K.A.Q


1 Answers

Each Firebase SDK is distributed as a precompiled universal binary containing multiple architectures: i386, armv7, x86_x64 and arm64, as well as bitcode. Additionally, the frameworks ship with module maps and header files, which contribute to the Pods size.

If the IPA is uploaded to the App Store or Test Flight, Apple will ensure that only relevant architecture is downloaded when the user installs the app on their device.

One way to test this is to upload the app to Test Flight and install it on your device - it should be way smaller.

If you want to get an idea of what your app size will be on a user device without uploading to Test Flight, try building in Xcode for one architecture only (normally arm64) while disabling bitcode.

If I try the pods mentioned in the question with the latest Firebase iOS release (4.8.1), the total size impact should be just over 3MB if measured with arm64 and no bitcode.

like image 180
David Airapetyan Avatar answered Sep 20 '22 02:09

David Airapetyan