https://kotlinlang.org logo
Title
m

Matouš Skála

03/28/2020, 1:35 PM
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

russhwolf

03/28/2020, 3:41 PM
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

Matouš Skála

03/28/2020, 5:22 PM
That works perfectly, thanks!
s

Sam

03/29/2020, 1:39 PM
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

Matouš Skála

04/07/2020, 1:34 PM
We run into issues when uploading the app using fatframework to the App Store. Code signing fails for some reason.
We are now compiling a kotlin native framework into xcframework (https://github.com/JetBrains/kotlin-native/issues/3423), but we are running into some issues when uploading the build to App Store Connect. It looks like XCode does not like there are both x64 and arm64 binaries bundled in the same xcframework.
s

Sam

04/07/2020, 2:20 PM
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

Matouš Skála

04/07/2020, 3:10 PM
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

Sam

04/07/2020, 3:17 PM
I think multiple releasable frameworks is what they really mean.