ios - Xcode Swift CocoaPods pod spec lint 在 Embed Pods 框架上失败
问题描述
尝试运行时出现以下错误pod spec lint --verbose
:
sent 1312397 bytes received 106 bytes 2625006.00 bytes/sec
total size is 1311832 speedup is 1.00
/var/folders/3d/v0m_90ty4mg1opbynpnjjvzh2010gm/T/CocoaPods-Lint-20181015-62030-oljqd-MySwiftPackage/Pods/Target Support Files/Pods-App/Pods-App-frameworks.sh: line 104: EXPANDED_CODE_SIGN_IDENTITY: unbound variable
Command PhaseScriptExecution failed with a nonzero exit code
** BUILD FAILED **
The following build commands failed:
PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks /Users/myuser/Library/Developer/Xcode/DerivedData/App-loplmnuztwibrzfqgadqoxucytrz/Build/Intermediates.noindex/App.build/Release/App.build/Script-09EB8340PON5K18DNW0C63DQ.sh
(1 failure)
Testing with `xcodebuild`.
-> MySwiftPackage (0.1.0)
- WARN | summary: The summary is not meaningful.
- WARN | description: The description is shorter than the summary.
- WARN | url: The URL (https://github.com/fishcharlie/MySwiftPackage) is not reachable.
- NOTE | xcodebuild: note: Using new build system
- NOTE | xcodebuild: note: Planning build
- NOTE | xcodebuild: note: Constructing build description
- NOTE | [iOS] xcodebuild: warning: Skipping code signing because the target does not have an Info.plist file. (in target 'App')
- WARN | xcodebuild: MySwiftPackage/MySwiftPackage/ViewControllers/Shared/MyFirstViewController.swift:102:37: warning: conditional cast from 'UIViewController' to 'MyViewController' (aka 'UIViewController') always succeeds
- WARN | xcodebuild: MySwiftPackage/MySwiftPackage/ViewControllers/Shared/MySecondViewController.swift:145:37: warning: conditional cast from 'UIViewController' to 'MyViewController' (aka 'UIViewController') always succeeds
- ERROR | [OSX] xcodebuild: Returned an unsuccessful exit code.
Analyzed 1 podspec.
[!] The spec did not pass validation, due to 1 error and 5 warnings.
我知道我有一些可以清理的警告。但我得到的只有一个错误,即- ERROR | [OSX] xcodebuild: Returned an unsuccessful exit code.
. 除此之外,它还说这Embed Pods Frameworks
是失败的原因。
不确定如何调试它,因为我可以在 Xcode 中构建和运行示例项目。
下面我也附上了我的 Podspec。
Pod::Spec.new do |s|
s.name = 'MySwiftPackage'
s.version = '0.1.0'
s.summary = 'A short description of MySwiftPackage.'
s.description = <<-DESC
TODO: Add long description of the pod here.
DESC
s.homepage = 'https://github.com/fishcharlie/MySwiftPackage'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'fishcharlie' => 'fishcharlie.code@gmail.com' }
s.source = { :git => 'https://github.com/fishcharlie/MySwiftPackage.git', :tag => s.version.to_s }
s.social_media_url = 'https://twitter.com/char_fish'
s.ios.deployment_target = '9.0'
s.osx.deployment_target = '10.11'
s.swift_version = '4.2'
s.source_files = 'MySwiftPackage/Classes/**/*', 'MySwiftPackage/ViewControllers/Shared/**/*'
s.ios.source_files = 'MySwiftPackage/ViewControllers/iOS/**/*'
s.osx.source_files = 'MySwiftPackage/ViewControllers/macOS/**/*'
s.resources = 'MySwiftPackage/Assets/**/*.{ttf,xcassets}'
s.dependency 'Alamofire', '4.7.3'
s.dependency 'Bond', '6.10.2'
s.ios.dependency '1PasswordExtension', '1.8.5'
end
关于如何修复/调试这个的任何想法?
解决方案
错误应该是关于
line 104: EXPANDED_CODE_SIGN_IDENTITY: unbound variable
解决方案(如github/Cocoapods 上的 Issue 7708 中所述)应将以下用户定义的设置添加到项目中:
EXPANDED_CODE_SIGN_IDENTITY="-"
EXPANDED_CODE_SIGN_IDENTITY_NAME="-"`
推荐阅读
- hyperledger-fabric - 是否可以使用 Hyperledger Fabric 的排序服务来交换其他消息?
- android - 如何使用 Kotlin 验证两个 arrayList 中的相等性
- c# - 当Window的大小改变时如何知道它是增加还是减少
- xml - Sabre 取消行程段错误 (OTA_CancelRQ)
- php - PHP opcache 预加载未在 Apache 上加载
- node.js - 使用 VISA API 生成 VISA 卡号
- git - 在 Gitlab 中推送存储库被拒绝错误
- javascript - ReactJS:第一个 useEffect 在第二个被触发之前不会更新状态
- python - 多索引数据帧上的 Pandas 布尔值枢轴
- angular - 使用 MatSelect 和 rxjs fromEvent 事件没有被听到?(选择更改)