我要疯了,我怎么才能让这个podspec发挥作用。
我正在开发一个快速的框架,需要CommonCrypto。经过许多问题使它对每个团队都有效(Cordova,React),这就是CommonCrypto的实现方式:
我在构建阶段获得了一个具有运行脚本的聚合目标CommonCryptoModuleMap:
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:
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以下是错误:
- 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'谢谢你的答复
发布于 2018-05-09 09:07:40
不过,似乎我并不是唯一一个在另一个SDK中包含CommonCrypto的失败。
我只是通过包含CryptoSwift来绕过这个问题(只使用纯Swift)。对我来说是完美的。它有点重,但您不必处理模块化地图文件和C库.非常容易使用,很好的实现。
这里是CryptoSwift:https://github.com/krzyzanowskim/CryptoSwift的链接
希望它能对你们中的一个有所帮助!
有人能解释一下为什么我会被投票吗?
https://stackoverflow.com/questions/50022096
复制相似问题