Jitsi-meet: iOS: XCode 11 Build Failed

Created on 23 Sep 2019  路  55Comments  路  Source: jitsi/jitsi-meet

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

Most helpful comment

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

All 55 comments

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

This was discussed in #4305 , that issue was closed, but the problem was not solved.

Adding -sdk iphoneos to the build command really avoids the build-time error, but produces a runtime error.

Unable to run on emulator, for example. And when launched on a physical device, such an assembly will lead to the following error:

dyld: Library not loaded: @ rpath / JitsiMeet.framework / JitsiMeet
聽聽 Referenced from: /var/containers/Bundle/Application/7816BF2D-59EF-4ECD-9C57-489316FBFE58/DrSmart.app/DrSmart
聽聽 Reason: image not found
(lldb)

I have the same issue. I opened the issue on the jitsi forums (https://community.jitsi.org/t/xcode-11-and-swift-5-1-sdk-error/19915) and I try to open the issue in the releases repo (https://github.com/jitsi/jitsi-meet-ios-sdk-releases/releases) but Is not possible 馃槥

Any solution on the horizon ?

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.

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

You can copy the Xcode 11 DeviceSupport files into Xcode 10.2 so it works on iOS 13: https://gist.github.com/steipete/d9b44d8e9f341e81414e86d7ff8fb62d

You can copy the Xcode 11 DeviceSupport files into Xcode 10.2 so it works on iOS 13: https://gist.github.com/steipete/d9b44d8e9f341e81414e86d7ff8fb62d

Thank you very much for the answer! I will try this method :)
Please tell me, will this method only work with XCode 10.2 or with 10.3 too?

It should work with any Xcode 10.

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

I have never experienced those errors, sorry. I don鈥檛 know how to help you.

Are you using JitsiMeet. framework from CocoaPods or are you building your own?

I have the same issue if I try to send my app to TestFlight, Im using CocoaPods. How is the state of the fix ?

What exact errors are you getting? I don鈥檛 see how compiling with one Xcode version or another has any importance in TestFlight acceptance.

Apple has recently made some important changes, unrelated to the Xcode update.

I have never experienced those errors, sorry. I don鈥檛 know how to help you.

Are you using JitsiMeet. framework from CocoaPods or are you building your own?

I am building jitsi manually :)

I just pushed a build to TestFlight with no issues (using Xcode 10.2) so I don't know what that alignment issue on WebRTC is about, sorry.

Getting issue Could not find module 'JitsiMeet' for target 'x86_64-apple-ios-simulator'; found: arm64 when building the Jitsi framework manually using Xcode 11. Has anyone faced the same issue?

Have you read this issue? Building with Xcode 11 does not work at the moment.

Okay, so I have figured it out on how to build the Jitsi framework in XCode 11. You need to remove the bitcode script present in build phases and then select the iPhone and iPad checkboxes in Development info. Also set the bitcode enabled setting to NO in build settings to false. After doing these steps you need to run the xcode command for building the Jisti SDK which is

xcodebuild -workspace ios/jitsi-meet.xcworkspace -scheme JitsiMeet -destination='generic/platform=iOS' -configuration Release archive

The Problem with the above fix is it works with actual devices but I am unable to run my Project in simulator and I get the issue

Could not find module 'JitsiMeet' for target 'x86_64-apple-ios-simulator'; found: arm64 when building the Jitsi framework manually using Xcode 11

Folks, please try compiling the SDK with https://github.com/jitsi/jitsi-meet/pull/4707 applied. That should work.

@jeetkapadia Youi don't need to touch bitcode related settings if you use the script in ios/scripts/release-sdk.sh

Hi, @saghul Thank you for your help. With the above help I was able to build the Jitsi Framework without any changes that I mentioned above. The only issue I am facing now is

Could not find module 'JitsiMeet' for target 'x86_64-apple-ios-simulator, i386-apple-ios-simulator'; found: arm64, x86_64, armv7-apple-ios, arm64-apple-ios, arm, armv7 when building the Jitsi framework manually using Xcode 11.

Let me know if you have an update on the same.

Undo your changes, apply the linked PR and build the SDK using the provided script.

@saghul thanks for your prompt response. I have taken the fresh new pull request and then executed the command for building the Jitsi Framework manually i.e the below command

xcodebuild -workspace ios/jitsi-meet.xcworkspace -scheme JitsiMeet -destination='generic/platform=iOS' -configuration Release archive

After adding that build framework into my Project, I am facing the above error which is

Could not find module 'JitsiMeet' for target 'x86_64-apple-ios-simulator, i386-apple-ios-simulator'; found: arm64, x86_64, armv7-apple-ios, arm64-apple-ios, arm, armv7 when building the Jitsi framework manually using Xcode 11.

Do let me know if I am doing anything wrong.

Thanks

Does your app declare support for Catalyst? (Is macOS ticked as supported?)

Before making this PR I made a sample project (which I'll push once this lands) which uses the Xcode 11 built frameworks and got no issues :-/

https://github.com/jitsi/jitsi-meet/pull/4707 landed. Please try using master and let us know if you run into issues.

The Fix suggested by @djorkaeffalexandre creates the Jitsi framework with architecture files for x86_64 and i386. And now I not able to get the other architectures like armv7, armv7s, arm64 and arm64e because they are missing which were previously built. Can you please suggest me some workaround for the same.
Architectures with the new Fix
PreviouslyGettingArchitectures

As you can see the first image is of new fix that was released today and the second image is of yesterday's fix. Some file architectures such as armv7, arm7s, arm64, and arm64e are missing in the first screenshot and i386 architecture files are missing in second screenshot.

Can you capture the output of the xcodebuild command and paste it somewhere?

I have updated my command. Basically all the architecture files should get generated when we run the release command. With the new fix, the previous architectures are not getting generated. Let me know if you need anything.

Also, I am very thankful for your prompt response.

I don't know what to say, really.

Here is what I'm doing:

$ xcodebuild -workspace ios/jitsi-meet.xcworkspace -scheme JitsiMeet -destination='generic/platform=iOS' -configuration Release archive

Then, check:

$ lipo -info ios/sdk/JitsiMeet.framework/JitsiMeet
Architectures in the fat file: ios/sdk/JitsiMeet.framework/JitsiMeet are: i386 x86_64 armv7 arm64

So how exactly are you building the SDK? What command are you adjusting? You shouldn't need to change anything on a checkout from master.

It seems that the issue continue con version 2.3.1 from cocoa

@JavierLaguna That's correct. You'll need to build it yourself until we publish 2.4.0.

And the 2.4.0 have an approximate release date on the horizon ?

I don't have one at the moment, but I'm going to try and push so we release it soon.

Okay, Thank you so much @saghul

You are using a very old API, please check the documentation at io/README.md

Looks like works XCode 11 with CocoaPods 2.4.0 version! Awesome! Thanks!

Good to hear!

Receiving this error using XCode 11.2 (11B52) with CocoaPods Version 1.5.2.

Module compiled with Swift 5.1 cannot be imported by the Swift 5.1.2 compiler: /App-Path/Pods/JitsiMeetSDK/Frameworks/JitsiMeet.framework/Modules/JitsiMeet.swiftmodule/arm64.swiftmodule

I was on XCode 10.3 ... but upgraded to XCode 11.2 because I installed the 2.4 version of the JitsiMeet iOS SDK ... due to receiving compiling error - Needed swift 5.1 and couldn't use swift 5.0 ... Now upgrading to XCode 11 causes issues because I'm apparently on the latest version of swift.

What steps can I take to resolve this @saghul ? Recompile JitsiMeetSDK using 5.1.2 version of Swift?

The latest Jitsi Meet SDK was compiled with Xcode 11.1. If you need a newer version you are going to need to compile it yourself.

We plan to release a new version soon, which will use Xcode 11.2.

Thanks for the clarification. I recompiled and it works great now.

Thanks for the advice, this method helped, but I still can鈥檛 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

@saghul I tried archiving the build in Xcode 11.3.1 and installed the sdk using CocoaPods ver 2.5.2 but the it says Could not find module 'JitsiMeet' for target 'armv7-apple-ios'; found: x86_64-apple-ios-simulator, arm64, x86_64, arm64-apple-ios. How to resolve this and archive successfully.

We don't support ARM v7 anymore. iOS 10 was the last version to support it, you must raise your deployment version to at least iOS 11.

@saghul Thanks it worked fine. One unusual thing happening is I am not able to join the conference in iOS 12.4.3 but in iOS 13.3 it is working fine. Url used is generated from our backend servers using Jitsi. Other thing is demo Jitsi link ie meet.jit.si/test123 is working fine for both iOS versions

I had the same issue, Are there any solution? Maybe run this version with xcode 10.3? Does anyone know any version that doesn't have this problem?

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

It seems that the issue continue in xcode 11.7.

@thanhsoncun What issue specifically?

I can鈥檛 upload the version to TestFlight due to the following errors (Jitsi build by xcode 11.7):
image

You seem to not have stripped the simulator architectures before upload.

@saghul how can i do that, i tried to do everything in this post. Please help me

You can use the script in your build phase: https://github.com/jitsi/jitsi-meet/blob/master/ios/scripts/fixup-frameworks.sh

this works perfectly for me, thanks.

@saghul thank so much.

I am facing this issue after Xcode update version 12.0. Anyone help me please.
ss

Getting error : -> Could not find module 'JitsiMeet' for target 'armv7-apple-ios'; found: arm64, arm64-apple-ios

For xcode 11.7
Version 2.10.0

You can use the script in your build phase: https://github.com/jitsi/jitsi-meet/blob/master/ios/scripts/fixup-frameworks.sh

this works perfectly for me, thanks.

sorry, how do you run that script? Thanks

Was this page helpful?
0 / 5 - 0 ratings