jitsi / jitsi-meet-sdk-samples

Jitsi Meet mobile SDK examples (Android, iOS and React Native)
Apache License 2.0
281 stars 239 forks source link

Failure to build against the SDK #33

Closed kgizdov closed 4 years ago

kgizdov commented 4 years ago

Hi,

I'm having trouble using the SDK. I've tried to use a CocoaPod pod in my app as described in the README as well as directly running the provided app samples here and none of them work at all. I keep getting the following errors:

// in x86_64-apple-ios-simulator.swiftinterface
...
// 'PiPViewCoordinator' is not a member type of JitsiMeet
23 | public static func == (a: JitsiMeet.PiPViewCoordinator.Position, b: JitsiMeet.PiPViewCoordinator.Position) -> Swift.Bool
...
// 'PiPViewCoordinator' is not a member type of JitsiMeet
29 | public var initialPositionInSuperview: JitsiMeet.PiPViewCoordinator.Position
...
// 'PiPViewCoordinatorDelegate' is not a member type of JitsiMeet
31 | weak public var delegate: JitsiMeet.PiPViewCoordinatorDelegate?
...
// 'AnimationCompletion' is not a member type of JitsiMeet
34 | public func show(completion: JitsiMeet.AnimationCompletion? = nil)
// 'AnimationCompletion' is not a member type of JitsiMeet
35 | public func hide(completion: JitsiMeet.AnimationCompletion? = nil)
...
// 'JMCallKitListener' is not a member type of 'JitsiMeet'
50 | @objc public static func addListener(_ listener: JitsiMeet.JMCallKitListener)
// 'JMCallKitListener' is not a member type of 'JitsiMeet'
51 | @objc public static func removeListener(_ listener: JitsiMeet.JMCallKitListener)
...
// 'PiPViewCoordinator' is not a member type of JitsiMeet
71 | extension JitsiMeet.PiPViewCoordinator.Position : Swift.Equatable {}
// 'PiPViewCoordinator' is not a member type of JitsiMeet
72 | extension JitsiMeet.PiPViewCoordinator.Position : Swift.Hashable {}

I couldn't really find the full source of the JitsiMeet module in order to try and see what is wrong. I also did not find the headers listing the inheritance. Maybe I didn't look in the right place.

However, if I do remove the JitsiMeet. inheritable specified in front, the SDK compiles, but it doesn't work. I'm guessing there is something amiss. Could you assist?

I am running on MacOS Catalina 10.15.4, Xcode 11.4, Swift 5.2. Thank you in advance.

buzzwin commented 4 years ago

I wasnt able to get the sample project to compile .. however I have been able to create my own IOS sample project and the sdk works perfectly . What I had to do was to rebuild the frameworks with the IOS Simulator option . Here is the command I used .. xcodebuild -workspace ios/jitsi-meet.xcworkspace -scheme JitsiMeet -destination='generic/platform=iOS, generic/platform=iOS Simulator' -configuration Release archive .. This is the only way I could get it to work in Xcode 11.4

kgizdov commented 4 years ago

@buzzwin seems to work

rgmez commented 4 years ago

I'm trying to generate framework with command line, but I'm still having an issue:

ARCHIVE FAILED The following build commands failed: CompileSwift normal arm64 CompileSwiftSources normal armv7 com.apple.xcode.tools.swift.compiler CompileSwift normal armv7

This is my command:

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

Are there any solution?

Thanks in advance

codal-hardik commented 4 years ago

@rgmez Once you completed with the above You can get the framework from DerivedData folder. ⁨Library⁩ ▸ ⁨Developer⁩ ▸ ⁨Xcode⁩ ▸ ⁨DerivedData⁩ ▸ ⁨jitsi-meet-fsnfbvqybaaxvpfxtsdwarplbgaj⁩ ▸ ⁨Build⁩ ▸ ⁨Intermediates.noindex⁩ ▸ ⁨ArchiveIntermediates⁩ ▸ ⁨JitsiMeet⁩ ▸ ⁨IntermediateBuildFilesPath.

fagerbua commented 4 years ago

@rgmez I assume you checked out the jitsi-meet repository and tried to build the framework there. Did you remember to install the dependencies before building? Here are the commands I used:

$TARGET_PROJECT='directory of your project'
mkdir -p $TARGET_PROJECT/ManuallyBuiltFrameworks
cd jitsi-meet
npm install
(cd ios; pod install)
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 $TARGET_PROJECT/ManuallyBuiltFrameworks

# Strip bitcode - reducing file size by almost a gigabyte.
cd $TARGET_PROJECT/ManuallyBuiltFrameworks
xcrun bitcode_strip -r Frameworks/JitsiMeet.framework/JitsiMeet -o Frameworks/JitsiMeet.framework/JitsiMeet
xcrun bitcode_strip -r Frameworks/WebRTC.framework/WebRTC -o Frameworks/WebRTC.framework/WebRTC
codal-hardik commented 4 years ago

@fagerbua See my answer here

Step 1: Download the repository from here

Step 2: Follow the steps for the readme file for ios here. (Once you completed the pod installation process mentioned on the above step & successfully run the application. Either by XCode or CLI.)

Step 3: Navigate to the ios directory and run the following command on terminal xcodebuild -workspace ios/jitsi-meet.xcworkspace -scheme JitsiMeet -destination='generic/platform=iOS, generic/platform=iOS Simulator' -configuration Release archive Get the framework from the derived data and put it into your project it will work. I managed this error in this way.

Step 4: You will get 2 frameworks (JitsiMeet and WebRTC). Their size is very big, so in order to decrease it, you have to strip bitcode using this command. "xcrun bitcode_strip -r JitsiMeet.framework/JitsiMeet -o JitsiMeet.framework/JitsiMeet" (for example on your Desktop)

Step 5: Drag & drop them in your project and in General tab for both of them select "Embed and Sign" option.

saghul commented 4 years ago

Or use Xcode 11.4

vijaypatidar2102 commented 4 years ago

DerivedData folder. ⁨Library⁩ ▸ ⁨Developer⁩ ▸ ⁨Xcode⁩ ▸ ⁨DerivedData⁩ ▸ ⁨jitsi-meet-fsnfbvqybaaxvpfxtsdwarplbgaj⁩ ▸ ⁨Build⁩ ▸ ⁨Intermediates.noindex⁩ ▸ ⁨ArchiveIntermediates⁩ ▸ ⁨JitsiMeet⁩ ▸ ⁨IntermediateBuildFilesPath.

At this path I didn't get the JitsiMeet and WebRTC framework. I have run script. :- xcodebuild -workspace jitsi.xcworkspace -scheme jitsi -destination='generic/platform=iOS' -configuration Release archive

And it succeed but I didn't get the framework

kleeb commented 3 years ago

same for me, even though the xcodebuild (Xcode 12.2) command succeeded the ios/sdk/JitsiMeet.framework is missing it generates jitsi-meet.app in derived folder

kleeb commented 3 years ago

ok, its because of https://github.com/jitsi/jitsi-meet/issues/8306