question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

iOS: XCode 11 Build Failed

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:59 (24 by maintainers)

github_iconTop GitHub Comments

8reactions
saghulcommented, Sep 23, 2019

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

5reactions
sashi01commented, Jun 29, 2020

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
Read more comments on GitHub >

github_iconTop Results From Across the Web

Build Failed — but no reason! | Apple Developer Forums
Hi, I'm experiencing weird Xcode behavior. I'm getting "build failed" after some alterations to the code, but Xcode will NOT give me the...
Read more >
Xcode: Build Failed, but no error messages - Stack Overflow
Build operation failed without specifying any errors. Individual build tasks may have failed for unknown reasons. One possible cause is if there ...
Read more >
Steps to resolve failed to build iOS app error - YouTube
45,6s Failed to build iOS app Error output from Xcode build: ↳ ** BUILD FAILED ** Could not build the application for the...
Read more >
Oh dear! Build errors? - LoopDocs - GitHub Pages
Open your project in Xcode as normal. Then go to the menu bar at the top of the screen and find the "Product"...
Read more >
Build: Failed to decode "signingCertificate" #6977 - GitHub
I was trying to build the iOS client again but this time with a different version of XCode but it failed. XCode 13.4;...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found