jitsi-meet: iOS: XCode 11 Build Failed
Description
I have a project that works great with Jitsi for a long time. But, when I upgraded XCode to version 11, I needed to build Jitsi for the latest version of the Swift lang in order to avoid the error “module compiled with swift 5.0.1 cannot be imported by the swift 5.1 compiler”.
Jitsi integration through Cocoapods still causes error “module compiled with swift 5.0.1 cannot be imported by the swift 5.1 compiler”, so I used manual installation: https://github.com/jitsi/jitsi-meet/tree/master/ios#builduing-it-yourself
but it causes the following error:
=== BUILD TARGET JitsiMeet OF PROJECT sdk WITH CONFIGURATION Release ===
Resolving target dependencies
Target 'Pods-JitsiMeet' of project 'Pods' was rejected as an implicit dependency for 'libPods-JitsiMeet.a' because it doesn't contain platform 'macosx' in its supported platforms 'iphonesimulator, iphoneos'
Check dependencies
target 'JitsiMeet' has bitcode enabled (ENABLE_BITCODE = YES), but it is not supported for the 'macosx' platform
Building for Mac Catalyst is not supported by the legacy build system.
** ARCHIVE FAILED **
Prior to Xcode 11 update, manual installation did not cause such errors
Steps to reproduce
- npm i
- cd ./ios
- pod install
- cd …
- open ios/jitsi-meet.xcworkspace in Xcode and hit play button
- xcodebuild -workspace ios/jitsi-meet.xcworkspace -scheme JitsiMeet -destination=‘generic/platform=iOS’ -configuration Release archive
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 1
- Comments: 59 (24 by maintainers)
Thanks for the report, we’ll look into this.
Here’s a complete reference of how it built for me.
git clone https://github.com/jitsi/jitsi-meet.git cd jitsi-meet npm install (cd ios; pod install)run jitsi-meet.xcworkspace in Xcode , should compile and run fine
The generated frameworks would be under ROOT_DIRECTORY/ManuallyBuiltFrameworks
Add the following script in :: BuildPhases > RunScript (make sure Run Script is at last)
# Type a script or drag a script file from your workspace to insert its path. APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}" # This script loops through the frameworks embedded in the application and # removes unused architectures. find "$APP_PATH" -name 'JitsiMeet.framework' -type d | while read -r FRAMEWORK do FRAMEWORK_EXECUTABLE_NAME=$(defaults read "$FRAMEWORK/Info.plist" CFBundleExecutable) FRAMEWORK_EXECUTABLE_PATH="$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME" echo "Executable is $FRAMEWORK_EXECUTABLE_PATH" EXTRACTED_ARCHS=() for ARCH in $ARCHS do echo "Extracting $ARCH from $FRAMEWORK_EXECUTABLE_NAME" lipo -extract "$ARCH" "$FRAMEWORK_EXECUTABLE_PATH" -o "$FRAMEWORK_EXECUTABLE_PATH-$ARCH" EXTRACTED_ARCHS+=("$FRAMEWORK_EXECUTABLE_PATH-$ARCH") done echo "Merging extracted architectures: ${ARCHS}" lipo -o "$FRAMEWORK_EXECUTABLE_PATH-merged" -create "${EXTRACTED_ARCHS[@]}" rm "${EXTRACTED_ARCHS[@]}" echo "Replacing original executable with thinned version" rm "$FRAMEWORK_EXECUTABLE_PATH" mv "$FRAMEWORK_EXECUTABLE_PATH-merged" "$FRAMEWORK_EXECUTABLE_PATH" done # This script loops through the frameworks embedded in the application and # removes unused architectures. find "$APP_PATH" -name 'WebRTC.framework' -type d | while read -r FRAMEWORK do FRAMEWORK_EXECUTABLE_NAME=$(defaults read "$FRAMEWORK/Info.plist" CFBundleExecutable) FRAMEWORK_EXECUTABLE_PATH="$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME" echo "Executable is $FRAMEWORK_EXECUTABLE_PATH" EXTRACTED_ARCHS=() for ARCH in $ARCHS do echo "Extracting $ARCH from $FRAMEWORK_EXECUTABLE_NAME" lipo -extract "$ARCH" "$FRAMEWORK_EXECUTABLE_PATH" -o "$FRAMEWORK_EXECUTABLE_PATH-$ARCH" EXTRACTED_ARCHS+=("$FRAMEWORK_EXECUTABLE_PATH-$ARCH") done echo "Merging extracted architectures: ${ARCHS}" lipo -o "$FRAMEWORK_EXECUTABLE_PATH-merged" -create "${EXTRACTED_ARCHS[@]}" rm "${EXTRACTED_ARCHS[@]}" echo "Replacing original executable with thinned version" rm "$FRAMEWORK_EXECUTABLE_PATH" mv "$FRAMEWORK_EXECUTABLE_PATH-merged" "$FRAMEWORK_EXECUTABLE_PATH" doneMy iphone for testing is on iOS13 and dont let me compile from Xcode10 😦
You can use the script in your build phase: https://github.com/jitsi/jitsi-meet/blob/master/ios/scripts/fixup-frameworks.sh
Undo your changes, apply the linked PR and build the SDK using the provided script.
We’ll fix it, but it may take a bit. Why do you need Xcode 11 specifically? If you are using Swift UI then yeah, sorry, I have no good answer right now, but if not, you should be able to build your app with Xcode 10 until this is fixed.
Add this run script in Build phases it will help you.
I don’t have one at the moment, but I’m going to try and push so we release it soon.
You can copy the Xcode 11 DeviceSupport files into Xcode 10.2 so it works on iOS 13: https://gist.github.com/steipete/d9b44d8e9f341e81414e86d7ff8fb62d