这里问同样的问题:XCFramework with Pods Dependency 但就我而言,我不能将其作为 cocoapod,我需要它是 XCFramework
我们的目标是创建一个隐藏我们内部代码的框架并向我们的客户提供SDK。我们想到创建满足我们要求的XCFramework。互联网上也有人建议采用伞形框架,但大多数建议避免这种方法。我们的框架依赖于我们通过 Pod 使用的一些第三方库。
Issue: XCFramework does not compile pods framework. We got an error like "Xyz(Pod) module not found". Even if we add pods from the client-side it does not work.
Code to create XCFramework is as bellow
Create an archive for iOS platform
xcodebuild archive -workspace ABC.xcworkspace
-scheme ABC
-sdk iphoneos
-archivePath "./archives/ios_devices.xcarchive"
BUILD_LIBRARY_FOR_DISTRIBUTION=YES
SKIP_INSTALL=NO
Create an archive for iOS-Simulator platform
xcodebuild archive -workspace ABC.xcworkspace
-scheme ABC
-sdk iphonesimulator
-archivePath "./archives/ios_simulators.xcarchive"
BUILD_LIBRARY_FOR_DISTRIBUTION=YES
SKIP_INSTALL=NO
Create an XCFramework from Archives
xcodebuild -create-xcframework
-framework ./archives/ios_devices.xcarchive/Products/Library/Frameworks/ABC.framework
-framework ./archives/ios_simulators.xcarchive/Products/Library/Frameworks/ABC.framework
-output build/ABC.xcframework
We got ABC XCFramework successfully but dependencies are not included in XCFramework. Any solution for this? or Is there any way where we can set framework search path to client-side? or Any alternate approach?
| 归档时间: |
|
| 查看次数: |
1987 次 |
| 最近记录: |