首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >podspec中框架的CommonCrypto

podspec中框架的CommonCrypto
EN

Stack Overflow用户
提问于 2018-04-25 12:14:50
回答 1查看 1K关注 0票数 1

我要疯了,我怎么才能让这个podspec发挥作用。

我正在开发一个快速的框架,需要CommonCrypto。经过许多问题使它对每个团队都有效(Cordova,React),这就是CommonCrypto的实现方式:

我在构建阶段获得了一个具有运行脚本的聚合目标CommonCryptoModuleMap:

代码语言:javascript
运行
复制
if [ -d "${BUILT_PRODUCTS_DIR}/CommonCryptoModuleMap" ]; then
echo "${BUILT_PRODUCTS_DIR}/CommonCryptoModuleMap directory already exists, so skipping the rest of the script."
exit 0
fi

mkdir -p "${BUILT_PRODUCTS_DIR}/CommonCryptoModuleMap"
cat <<EOF > "${BUILT_PRODUCTS_DIR}/CommonCryptoModuleMap/module.modulemap"
module CommonCrypto [system] {
    header "${SDKROOT}/usr/include/CommonCrypto/CommonCrypto.h"
    export *
}
EOF

但是现在,我们的目标是将它作为Swift中另一个框架的依赖来实现。因此,我必须在podspec中指定目标依赖项。

从Xcode构建或存档它没有问题。

这是我的Podspec:

代码语言:javascript
运行
复制
Pod::Spec.new do |s|
  s.name               = "AFrameworkHasNoName"
  s.version            = "0.1.5"
  s.summary            = "Foo bar"
  s.homepage           = "https://github.com/MyRepository_ios"
  s.license            = "License"
  s.author             = { "Veesla" => "valentin.cousien@gmail.com" }
  s.source             = { :git => "git@github.com:MyRepository_ios.git", :tag => "develop" }
  s.swift_version      = "4.0"
  s.platform           = :ios, "8.0"
  s.requires_arc       = true
  s.exclude_files      = "AFrameworkHasNoNameTests/*"
  s.source_files       = "AFrameworkHasNoName/**/*.{h,m,swift}"
  s.module_name        = "AFrameworkHasNoName"
end

以下是错误:

代码语言:javascript
运行
复制
- WARN  | source: The version should be included in the Git tag.
    - WARN  | source: Git SSH URLs will NOT work for people behind firewalls configured to only allow HTTP, therefore HTTPS is preferred.
    - WARN  | url: The URL (https://github.com/MyRepository_ios) is not reachable.
    - WARN  | [iOS] license: Unable to find a license file
    - ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code. You can use `--verbose` for more information.
    - ERROR | [iOS] xcodebuild:  MyFileImportingCommonCrypto.swift:10:8: error: no such module 'CommonCrypto'

谢谢你的答复

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-05-09 09:07:40

不过,似乎我并不是唯一一个在另一个SDK中包含CommonCrypto的失败。

我只是通过包含CryptoSwift来绕过这个问题(只使用纯Swift)。对我来说是完美的。它有点重,但您不必处理模块化地图文件和C库.非常容易使用,很好的实现。

这里是CryptoSwift:https://github.com/krzyzanowskim/CryptoSwift的链接

希望它能对你们中的一个有所帮助!

有人能解释一下为什么我会被投票吗?

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50022096

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档