【发布时间】:2018-04-25 12:14:50
【问题描述】:
我对如何让这个 podspec 工作感到很生气。
我正在开发一个 swift 框架,需要 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'
感谢您的回复
【问题讨论】:
-
CommonCrypto 默认可用,不应明确指定。更多stackoverflow.com/questions/9839193/…
-
“不应指定”是什么意思?没有进口?
标签: swift cocoa cocoapods podspec commoncrypto