xxx.podspec参数
xxx.podspec
更多参数:送传送门
错误解决方案
-
执行
pod lib lint
来编译 cocoapods 的 xxx.podspec 文件时报错:- ERROR | [iOS] unknown: Encountered an unknown error (/usr/bin/xcrun simctl list -j devices
的解决办法:
打开你的 Xcode,点开设置:然后找到这个地方:
默认应该是空的,把这个选项选好。
然后再去检验xxx.podspec
文件,应该就没问题了。出现的其他错误基本都很好解决。 -
执行
pod lib lint
时报错:- ERROR | [iOS] unknown: Encountered an unknown error (Could not find a
iossimulator (valid values: ). Ensure that Xcode -> Window -> Devices has at least one
iossimulator listed or otherwise add one.) during validation.
的解决办法:- 升级CocoaPods(使用的gem 源: https://gems.ruby-china.com/):
sudo gem install cocoapods
; - 再次执行
pod lib lint
,即可验证通过;
- 升级CocoaPods(使用的gem 源: https://gems.ruby-china.com/):
-
执行
pod trunk push CYBaseOC.podspec
或pod trunk push CYBaseOC.podspec --allow-warnings
时报错:- ERROR | [iOS] unknown: Encountered an unknown error ([!] /usr/bin/git clone https://github.com/specialc/CYBaseOC.git /var/folders/g8/b2xkm9sx0sdgl3t6k5jw8mv00000gn/T/d20191010-55168-1m63l5g --template= --single-branch --depth 1 --branch 0.1.0 Cloning into '/var/folders/g8/b2xkm9sx0sdgl3t6k5jw8mv00000gn/T/d20191010-55168-1m63l5g'... warning: Could not find remote branch 0.1.0 to clone. fatal: Remote branch 0.1.0 not found in upstream origin ) during validation.
的解决办法:
意思是发现不了版本号,因此需要把上述git代码变成 0.1.0(注意大小写):git tag 'v0.1' git push --tags git push origin master
原因是在podspec文件中:
tag => "v#{s.version}"
注意前面的那一个字母的
v
.
这样就可以正确的pod trunk push CYBaseOC.podspec
了! -
执行pod trunk push CYBaseOC.podspec或pod trunk push CYBaseOC.podspec --allow-warnings时报错:
- ERROR | xcodebuild: /Users/yn2019/Library/Developer/Xcode/DerivedData/App-hedycotmznrtdvazrjnqujoivzeu/Build/Products/Release-iphonesimulator/CYBaseOC/CYBaseOC.framework/Headers/CY_Model.h:12:9: error: include of non-modular header inside framework module 'CYBaseOC.CY_Model': '/Users/yn2019/Library/Developer/Xcode/DerivedData/App-hedycotmznrtdvazrjnqujoivzeu/Build/Products/Release-iphonesimulator/JSONModel/JSONModel.framework/Headers/JSONModel.h' [-Werror,-Wnon-modular-include-in-framework-module]
这个错误是路径的问题,我的代码中用到了
JSONModel
,引用的方式是#import "JSONModel.h"
,改成#import <JSONModel/JSONModel.h>
就可以了。