6

I have a XCFramework which depends upon several static frameworks.

My XCFramework is built with BUILD_FOR_LIBRARIES_FOR_DISTRIBUTION enabled.

The sub frameworks don't need to be accessible from outside the XCFramework.

When I try to compile my XCFramework in the client(host) app, I am getting en error in the XCFramework's .swiftinterface file saying No such module 'FBSDKLoginKit' (FBSDKLoginKit is one of the XCFramework sub frameworks)

What seems to be missing is the swiftinterface files for the dependent modules. For example, I am using FBSDKLoginKit but the swiftinterface is not there within the XCFramework.

For reference I'm compiling the the framework as follows:

xcodebuild archive -project "TestFrameowrk.xcodeproj" -scheme "TestFrameowrk" -sdk iphoneos -archivePath ~/Desktop/xcframework.arm SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES

xcodebuild archive -project "TestFrameowrk.xcodeproj" -scheme "TestFrameowrk" -sdk iphonesimulator -archivePath ~/Desktop/xcframework.x86 SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES

xcodebuild -create-xcframework -framework ~/Desktop/xcframework.x86.xcarchive/Products/Library/Frameworks/TestFrameowrk.framework  -framework ~/Desktop/xcframework.arm.xcarchive/Products/Library/Frameworks/TestFrameowrk.framework -output ~/Desktop/Framework.xcframework
Dubon Ya'ar
  • 349
  • 4
  • 13
  • Were you able to figure this out? I'm trying to do something similar. Is the only way to add the dependency on the client-side? – Zach Jan 27 '21 at 21:06
  • I've had similar issues with static frameworks on xcode 12.4. The deps are being fulfilled via the clients podfile but it all only works with dynamic frameworks. static gives either the `No such module` error or it `Undefined symbol` at link time – Hari Honor Feb 04 '21 at 09:45

2 Answers2

0

Did you try adding other dependencies separately with your created XCFramework when you integrate with client project? Looks like, apple recommends to avoid using umbrella/nested frameworks with XCFramework.

0

Yes I had same issue happening with alamofire dependency . so what happening is when you generate xcframeworks you have dependency with FBSDKLoginKit fine . But after generating frameworks your client want to use .you also have to mention dependency as FBSDKLoginKit with same version then this problem not happen . For me I solves after adding alamofire adding in client side.

TheCodeTalker
  • 685
  • 6
  • 14