Hi. when I try to build kmp app from Xcode with Pr...
# compose-ios
g
Hi. when I try to build kmp app from Xcode with Product > Archive it takes too much time, like 30 mins or more. in Activity Monitor I see only one java process using only one cpu core at 100%. Any way to speed the build? I would expect it to use more CPU just like when compiling on Android
image.png
a
Hi! Archiving is always a slow process because it uses a clean build and release configuration. It also depends on the Mac config you're working on.
Could you please share a full build log to take a look on it?
l
I asked about the same thing a while ago, it seems that the native compiler is single threaded only, which is a huge bottleneck. https://youtrack.jetbrains.com/issue/KT-49379/Kotlin-Native-Is-there-a-way-to-improve-clang-performance#focus=Comments-27-5467487.0-0
😞 2
g
Screenshot 2025-03-08 at 19.55.19.png
kodee loading 1
it took 4 hours on M1 Mac kodee sad
Build iosApp_2025-03-06T23-51-14.txt
r
I'd say iOS support should not be marked as beta until issues such as these are resolved. And until Swift direct interop is a thing.
a
it took 4 hours on M1 Mac
Wow, that's scary. Unfortunately with no timecodes it's hard to say what was wrong there. I can see that project has lots of iOS dependencies, and there is very little about kotlin compilation itself. To say more I have to see kotlin library build task log (with time code if it's possible).
g
where are kotlin library build task logs? regarding dependencies, not sure if it is a lot but here is the pic. Im using Apple and Google login, also Crashlytics which require those deps
not much Swift in project. 99.9% is Kotlin. Also hard to say when this happened exactly, for few months I neglected iOS and have not even opened Xcode :D
To check Kotlin part, you probably need something like: • clear build cache • ./gradlew linkReleaseFrameworkIosArm64 But you also have to use some tool to analyze the build time.
g
forgot to clear cache. Anyway this seems to have exactly same behavior. at first it started at 200 cpu usage, now it's no more than 100
But you also have to use some tool to analyze the build time.
could you give more info here? I don't know any tool that will help here
still going
1
Screenshot 2025-03-10 at 23.16.46.png
sad panda
a
Are you using Kotlin 2.1.20-RC2 ? It might be the issue. https://youtrack.jetbrains.com/issue/CMP-7747 You can try 2.1.20-RC, but it has some problems with backward compatibility of Kotlin libraries.
g
yep, otherwise my app crashes on startup...