XCFramework with static frameworks sub dependencies(具有静态框架子依赖项的 XCFramework)
问题描述
我有一个依赖于几个静态框架的 XCFramework.
I have a XCFramework which depends upon several static frameworks.
我的 XCFramework 是在启用 BUILD_FOR_LIBRARIES_FOR_DISTRIBUTION 的情况下构建的.
My XCFramework is built with BUILD_FOR_LIBRARIES_FOR_DISTRIBUTION enabled.
不需要从 XCFramework 外部访问子框架.
The sub frameworks don't need to be accessible from outside the XCFramework.
当我尝试在客户端(主机)应用程序中编译我的 XCFramework 时,我在 XCFramework 的 .swiftinterface 文件中出现错误提示 No such module 'FBSDKLoginKit'(FBSDKLoginKit 是 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)
似乎缺少的是依赖模块的 swiftinterface 文件.例如,我使用的是 FBSDKLoginKit,但 XCFramework 中没有 swiftinterface.
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
推荐答案
是的,我在 alamofire 依赖项中遇到了同样的问题.所以发生的事情是当你生成 xcframeworks 时,你对 FBSDKLoginKit 有依赖关系.但是在生成您的客户想要使用的框架之后.您还必须提到具有相同版本的 FBSDKLoginKit 的依赖关系,然后这个问题就不会发生.对我来说,我在客户端添加 alamofire 添加后解决了.
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.
这篇关于具有静态框架子依赖项的 XCFramework的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:具有静态框架子依赖项的 XCFramework
基础教程推荐
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01
- iOS4 创建后台定时器 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
