cocoapads添加依赖私有库,提交报错的问题解决
自己的一个私有库添加了另一个私有库,进行验证时报如下错误:找不到相对应的类库
<pre><code>
localhost:XTBloginPage liuyihua$ pod lib lint
XTBloginPage (0.1.6)
ERROR | [iOS] unknown: Encountered an unknown error (Unable to find a specification for `XTBBaseLib/Network` depended upon by `XTBloginPage`) during validation.
[!] XTBloginPage did not pass validation, due to 1 error.
[!] The validator for Swift projects uses Swift 3.0 by default, if you are using a different version of swift you can use a `.swift-version` file to set the version for your Pod. For example to use Swift 2.3, run:
`echo "2.3" > .swift-version`.
You can use the `--no-clean` option to inspect any issue.
</code></pre>
localhost:XTBloginPage liuyihua$ pod env
### 主要的原因是cocoapods不知道你的私有库存放在那一个远程库中,需要自己明示仓库来源 :本地验证和提交远程都一样;
#### $pod lib lint --sources='https://git.coding.net/xxxxxx/LYHXTBSepc.git,https://github.com/CocoaPods/Specs.git' --use-libraries --allow-warnings
localhost:XTBloginPage liuyihua$ pod lib lint --sources='https://git.coding.net/xxxxxx/LYHXTBSepc.git,https://github.com/CocoaPods/Specs.git' --use-libraries --allow-warnings
-> XTBloginPage (0.1.6)
XTBloginPage passed validation.
localhost:XTBloginPage liuyihua$
###提交远程仓库
localhost:XTBBaseLib liuyihua$ pod repo push LYHXTBSepc Lib.podspec --sources='https://git.coding.net/xxxxxx/LYHXTBSepc.git,https://github.com/CocoaPods/Specs.git' --use-libraries --allow-warnings
###验证通过!
网友评论