firebase / firebase-ios-sdk

Firebase SDK for Apple App Development
https://firebase.google.com
Apache License 2.0
5.55k stars 1.45k forks source link

20 MB increasing in total app size after adding Analytics using SPM #6298

Closed 0xifarouk closed 4 years ago

0xifarouk commented 4 years ago

Step 0: Are you in the right place?

[REQUIRED] Step 1: Describe your environment

[REQUIRED] Step 2: Describe the problem

Steps to reproduce:

What happened? How can we make the problem occur? I added the Analytics component to my project, and noticed that the app size got increased by 20 MB, the only thing that I did is installing Analytics using SPM, then I got this huge increase in the app size.

Before installing: IMG_6635

After Installing: IMG_6609

If you have a downloadable sample project that reproduces the bug you're reporting, you will likely receive a faster response on your issue.

Relevant Code:

import SwiftUI
import FirebaseCore

@main
struct QuranVoice: App {

    var body: some Scene {

        WindowGroup {
            SurasView()
                .environmentObject(DownloadManager.shared)
                .environmentObject(FavoriteSuras.shared)
                .environmentObject(ThemeManager.shared)
                .environmentObject(FavoriteReciters.shared)
                .onAppear {
                    FirebaseApp.configure()
                }
        }        
    }
}
google-oss-bot commented 4 years ago

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

paulb777 commented 4 years ago

I see an increase of 1.1MB after adding Analytics with SPM the empty app goes from 75K to 1.2M:

~/Library/Developer/Xcode/DerivedData/size3-fndzwranmxfiyqbwwocrbpnhexqf/Build/Products/Debug-iphoneos/size3.app  $ ls -l
total 192
drwxr-xr-x  4 paulbeusterien  primarygroup    128 Aug 19 08:55 Base.lproj
-rw-r--r--  1 paulbeusterien  primarygroup   1463 Aug 19 08:55 Info.plist
-rw-r--r--  1 paulbeusterien  primarygroup      8 Aug 19 08:55 PkgInfo
drwxr-xr-x  3 paulbeusterien  primarygroup     96 Aug 19 08:55 _CodeSignature
-rw-r--r--  1 paulbeusterien  primarygroup   9435 Aug 19 08:55 embedded.mobileprovision
-rwxr-xr-x  1 paulbeusterien  primarygroup  75472 Aug 19 08:55 size3
~/Library/Developer/Xcode/DerivedData/size3-fndzwranmxfiyqbwwocrbpnhexqf/Build/Products/Debug-iphoneos/size3.app  $ file size3
size3: Mach-O 64-bit executable arm64
~/Library/Developer/Xcode/DerivedData/size3-fndzwranmxfiyqbwwocrbpnhexqf/Build/Products/Debug-iphoneos/size3.app  $ ls -l
total 2408
drwxr-xr-x  4 paulbeusterien  primarygroup      128 Aug 19 08:55 Base.lproj
-rw-r--r--  1 paulbeusterien  primarygroup     1463 Aug 19 09:00 Info.plist
-rw-r--r--  1 paulbeusterien  primarygroup        8 Aug 19 09:00 PkgInfo
drwxr-xr-x  3 paulbeusterien  primarygroup       96 Aug 19 08:55 _CodeSignature
-rw-r--r--  1 paulbeusterien  primarygroup     9435 Aug 19 08:55 embedded.mobileprovision
-rwxr-xr-x  1 paulbeusterien  primarygroup  1209456 Aug 19 09:00 size3
morganchen12 commented 4 years ago

Building for iOS 14 on arm64, the whole app bundle is 2.6MB. @FaroukZeino can you share a project that reproduces this issue?

0xifarouk commented 4 years ago

Sorry for being late, unfortunately I wasn't able to reproduce the issue with a new project, it's occurring with my previously created project, which is a SwiftUI app that I am working on.

paulb777 commented 4 years ago

Thanks for checking. We'll close for now and can reopen with a reproducible example.