JetBrains / compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
https://jetbrains.com/lp/compose-multiplatform
Apache License 2.0
15.24k stars 1.11k forks source link

Reduce ios app size. #4855

Closed begali closed 1 month ago

begali commented 1 month ago

I created KMP + compose multiplatform (android and ios) using this site and run for ios simulator from android studio. The app size for ios simulator are: debug version 40.5mb and release version 50.8mb. By the way I selected debug and release versions from android studio by editing device configurations and din't add any libraries. If I create KMP project without CM, then app size for ios is 1.7mb. How can we reduce app size for compose multipatform. What is the skia/skiko library size bundled with ios framework?

hellomr3 commented 1 month ago

face same probleam! my release ios app is 13mb+

brewin commented 1 month ago

There's an optimized property that reduces the app size. I don't know exactly what it does though and I've never found any documentation for it. I'm not sure if it's safe to use.

kotlin {
    iosArm64 {
        binaries{
            framework { 
                optimized = true
            }
        }
    }
}

or

kotlin {
    cocoapods {
        framework {
            optimized = true
        }
    }
}
Thomas-Vos commented 1 month ago

Release builds are already optimized so no need for that option

Thomas-Vos commented 1 month ago

iOS apps being about 10x as large as Android apps is quite normal. Just take a look at other (popular) iOS apps on the App Store. Personally I do not see current app sizes as an issue at all.

MatkovIvan commented 1 month ago

It seems as a duplicate of #3632