我在我的 swift 类中使用 CommonCrypto 库:
import CommonCrypto
它工作正常,当我在 Xcode 中构建我的项目时它没问题。我已经使用 git 将我的代码上传到存储库。当我克隆此代码并尝试使用命令构建存档时:
xcodebuild -project PNG.xcodeproj -scheme PNG -sdk iphoneos -configuration AppStoreDistribution archive -archivePath $PWD/build/PNG.xcarchive
我得到错误:
....swift:38:8: error: no such module 'CommonCrypto'
怎么了?我怎样才能解决这个问题?为什么在我的本地项目中它可以工作,而从存储库中克隆项目却不行?感谢帮助
最佳答案
您需要添加 #import <CommonCrypto/CommonCrypto.h>
到桥接头并包含 Security.framework
在项目中。
关于ios - 将 CommmonCrypto 库导入 Swift 项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41501311/