ethand91 / mediasoup-ios-client

Mediasoup 3 iOS Client
ISC License
131 stars 65 forks source link

Apple deprecated the ability to use "fat" frameworks . Only .xcframework are allowed, however no guide how to integrate it #98

Open Rostyk opened 3 years ago

Rostyk commented 3 years ago

Fat library issues It would be great to be able to use a .xcframework rather than a "fat" .framework containing an iOS and iOS simulator slice.

Building a "Fat" framework (as mentioned in the build guide of mediasoup) cannot be built directly by Xcode, and is not supported any more: apple support discussion here

I made a "fat" library as in the guide here, then dragged libwebrtc.a, libmediasoup.a, libsdptransform.a and 15 public headers to xCode 12 hello world project and did not manage to make the linker work.

Always getting Undefined symbols for architecture arm64: "_OBJC_CLASS_$_MediasoupDevice", referenced from: objc-class-ref in ViewController.o ld: symbol(s) not found for architecture arm64

So as of now unfortunately it is not possible to make it work using the Install guide.

xcframework I built a mediasoup client xcframework and dragged it to xCode 12/11 project. (Checked all the embed settings). The app compiles and start however immediately crashes with

  EXC_BAD_INSTRUCTION
  mediasoup_client_ios`std::__1::__libcpp_atomic_refcount_increment<long>:

Link to image with xCode stack

Any input would be appreciated, thanks

Rostyk commented 3 years ago

Yep, the crash

libcpp_atomic_refcount_increment<long> 

is permanent when you try to use mediasoup_client_ios .xcframework in xCode 11/12

ethand91 commented 3 years ago

Since simulator doesn't support camera, at some point I would like to remove the simulator archs from the library.

Yes xcframework does need to be supported... I just wish the webrtc library wasn't so huge :/

fedulvtubudul commented 3 years ago

I've managed to build XCFramework that works on all modern devices and simulators. You can find the project and build scripts for dependencies in our fork: https://github.com/VLprojects/mediasoup-ios-client/blob/master/build.sh