问题描述
在iOS Framework项目中,我们具有Obj C和Swift代码,我们构建了一个.framework,并通过代码存储库进行分发,以供其他应用程序项目进行集成。
我们生成的构建是一个通用框架,因此它既可以在设备上运行,也可以在模拟器上运行。
最近在Xcode 12 iOS 14中,由于我们使用lipo组合了模拟器和设备架构的框架,因此生成生成失败,如答案iOS 14,lipo error while creating library for both device and simulator所示,如答案所示,然后从模拟器构建中排除了arm64架构lipo cmd正常工作并构建了Framework,以下是我们使用的构建命令
simulator:
MySDK -target MySDK ONLY_ACTIVE_ARCH=NO -configuration ${CONfigURATION} -sdk iphonesimulator BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" OBJROOT="${OBJROOT}/DependentBuilds" EXCLUDED_ARCHS="arm64"
device:
MySDK -target MySDK ONLY_ACTIVE_ARCH=NO -configuration ${CONfigURATION} -sdk iphoneos BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" OBJROOT="${OBJROOT}/DependentBuilds"
现在,当此.framework使用cocoapods与其他应用程序项目(MyProject)集成在一起时。使用以下命令构建项目时,出现以下错误
xcodebuild install -scheme MyProject -workspace MyProject.xcworkspace -destination 'platform=iOS Simulator,name=iPhone 8'
** INSTALL Failed **
The following build commands Failed:
CompileSwift normal x86_64
CompileSwift normal x86_64
CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
CompileSwift normal x86_64
/Users/path/to/MyProject/Pods/MySDK/MySDK.framework/Modules/MySDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface:21:96: error: 'someStruct' is not a member type of 'MySDK'
@objc public func someMethod(some: args) -> Swift.void)
注意:集成了MySDK(Framework)的项目可以正常工作,我们可以通过Xcode在设备或模拟器上运行,但是运行上述命令时会出现这些错误
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)