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)

Most upvoted comments

Thanks for the report, we’ll look into this.

Here’s a complete reference of how it built for me.

XCode 11.5.1 , Cocapods : 1.9.3 , Jitsi-Meet (master) : HEAD @ 7dfff1b4552c6522280326a50ae3ac7324df953e

  • Cloning the core repo and make it functional

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

  • Making build Make any custom changes to the repo(if required), then build using following
mkdir -p ManuallyBuiltFrameworks
xcodebuild -workspace ios/jitsi-meet.xcworkspace -scheme JitsiMeet -destination='generic/platform=iOS' -configuration Release archive

# Copy the built frameworks. the -H option is needed to follow the initial symlink.
cp -RH ios/sdk/JitsiMeet.framework node_modules/react-native-webrtc/ios/WebRTC.framework ./ManuallyBuiltFrameworks

# Strip bitcode - reducing file size by almost a gigabyte.
cd ManuallyBuiltFrameworks/
xcrun bitcode_strip -r JitsiMeet.framework/JitsiMeet -o JitsiMeet.framework/JitsiMeet
xcrun bitcode_strip -r WebRTC.framework/WebRTC -o WebRTC.framework/WebRTC

The generated frameworks would be under ROOT_DIRECTORY/ManuallyBuiltFrameworks

Note : Bitcode is disabled

  • Integrate in Project Drag drop the files in your XCode project. Under General > Frameworks , make sure JitsiMeet and WebRTC is “Embed & Sign” Screenshot 2020-06-29 at 12 23 19 PM

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"

done

My iphone for testing is on iOS13 and dont let me compile from Xcode10 😦

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.

Thanks for the advice, this method helped, but I still can’t upload the version to TestFlight due to the following errors: image

Add this run script in Build phases it will help you.

# 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 '*.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

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