Hello! We are building frameworks in parallel and ...
# multiplatform
m
Hello! We are building frameworks in parallel and then using
lipo
for merging them in a single xcframework. We are using these two commands in parallel for building the frameworks
./gradlew :assembleDebugIosSimulatorFatFrameworkForKmmSdkXCFramework
./gradlew :assembleDebugIosFatFrameworkForKmmSdkXCFramework
And then we use these
lipo
and
xcodebuild
commands
Copy code
xcrun lipo -create /path_to_build_folder/bin/iosSimulator/KmmSdkDebugFramework/KmmSdk.framework/KmmSdk /path_to_build_folder/bin/iosSimulatorArm64/KmmSdkDebugFramework/KmmSdk.framework/KmmSdk -o /path_to_build_folder/bin/iosSimulator/KmmSdkDebugFramework/KmmSdk.framework/KmmSdk

xcrun lipo -create /path_to_build_folder/bin/iosSimulator/KmmSdkDebugFramework/KmmSdk.framework.dSYM/Contents/Resources/DWARF/KmmSdk /path_to_build_folder/bin/iosSimulatorArm64/KmmSdkDebugFramework/KmmSdk.framework.dSYM/Contents/Resources/DWARF/KmmSdk -o /path_to_build_folder/bin/iosSimulator/KmmSdkDebugFramework/KmmSdk.framework.dSYM/Contents/Resources/DWARF/KmmSdk

xcodebuild -create-xcframework -framework /path_to_build_folder/bin/iosSimulator/KmmSdkDebugFramework/KmmSdk.framework -debug-symbols /path_to_build_folder/bin/iosSimulatorArm64/KmmSdkDebugFramework/KmmSdk.framework.dSYM \
 -framework /path_to_build_folder/bin/iosArm64/KmmSdkDebugFramework/KmmSdk.framework -debug-symbols /path_to_build_folder/bin/iosArm64/KmmSdkDebugFramework/KmmSdk.framework.dSYM \
 -output "KmmSdk.xcframework"
This approach worked perfectly with kotlin 1.8.10 but it fails in kotlin 1.8.21 with the following error (first
lipo
command)
fatal error: /Applications/Xcode-14.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: can't figure out the architecture type of: /path_to_build_folder/bin/iosSimulatorArm64/KmmSdkDebugFramework/KmmSdk.framework/KmmSdk
Was something changed between these two kotlin versions?
plus1 4