ios - 将 CommmonCrypto 库导入 Swift 项目

标签 ios swift git xcodebuild commoncrypto

我在我的 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/

相关文章:

iphone - iOS旋转设备无旋转动画

ios - 在 TabBarController 中到达 ViewController

ios - GMSAutocompleteViewController 获取完整地址

ios - 单个 iOS 应用程序的多个 facebook 应用程序 ID

ios - 你如何在 Swift 中将 NSValue pointerValue() 转换为 UIView?

Git 相当于 Mercurial "hg commit -A -m <message>"

Git 指纹与 Azure 不匹配

ios - `pod install` 之后的空 Pod header 文件夹

ios - 如何在 swift 中使用自定义导航栏制作三个分页 View

git - GitHub 中的比较工具(比较发行版,或在必要时比较 shas)