具有静态框架子依赖项的XCFramework [英] XCFramework with static frameworks sub dependencies

查看:69
本文介绍了具有静态框架子依赖项的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文件中遇到错误,提示没有这样的模块'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中没有swift接口.

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 fine有依赖性.但是在生成您的客户端要使用的框架之后,您还必须提及具有相同版本的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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆