Hi, we are having issues with the latest Xcode 11....
# ios
m
Hi, we are having issues with the latest Xcode 11.4 when switching targets between simulators and device. We use the approach described in https://play.kotlinlang.org/hands-on/Targeting%20iOS%20and%20Android%20with%20Kotlin%20Multiplatform/06_SettingUpKotlinFramework to load the framework for the corresponding architecture in build phase. But it looks like the latest Xcode validates target integrity before running build phases, so the only workaround is to clean the build folder manually whenever the build target is changed, which is annoying. Has anyone found a better solution?
r
Haven’t updated xcode yet myself, but one thing you could try is doing a fat framework instead. See https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#building-universal-frameworks
m
That works perfectly, thanks!
s
How badly does this slow compilation? My k/n project is getting pretty large and it already takes a long time to compile it.
m
We run into issues when uploading the app using fatframework to the App Store. Code signing fails for some reason.
s
Yes. You cannot uploads frameworks with x64 simulator slices in them to Apple. Your best bet is to use lipo to take them out in an Xcode build step that runs during a release build. http://ikennd.ac/blog/2015/02/stripping-unwanted-architectures-from-dynamic-libraries-in-xcode/
m
Thanks, we’ll try that! But I thought that’s the whole purpose of the new xcframework bundle type to be able to include multiple architectures in a single framework, at least that’s what they claimed at WWDC: https://developer.apple.com/videos/play/wwdc2019/416/
s
I think multiple releasable frameworks is what they really mean.