< 返回首页

标哥的笔记,是记录在日常学习技术和日常开发中那些年遇到过的坑!本站为新站,原"标哥的技术博客"中的文章会慢慢移到本站,欢迎收藏本站!
在使用本站过程中,有任何建议请联系标哥! 另,承接App开发、网站开发和微信小程序开发!欢迎联系我们


Pod提示Remote branch not found in upstream origin

 作者:标哥    发布日期:2017-01-12 21:30    阅读量:24146次
 

今天准备发布最新开源项目HYBHelperKit,但是在发布时忘记打上git tag ‘v0.0.1',结果一直报错,弄了好久才找到原因!在这里写下来,也许下一个出现此类问题的人就是你!

报错信息

Validating podspec
 -> HYBHelperKit (0.0.1)
    - ERROR | [iOS] unknown: Encountered an unknown error ([!] 
    /Applications/Xcode.app/Contents/Developer/usr/bin/
    git clone https://github.com/CoderJackyHuang/HYBHelperKit.git
    /var/folders/tx/fwfjfxpd7318fs37s78c6q5c0000gn/T/d20160709-15448-1mcnv9t
     --template= --single-branch --depth 1 --branch v0.0.1

Cloning into '/var/folders/tx/fwfjfxpd7318fs37s78c6q5c0000gn/T/d20160709-15448-1mcnv9t'...
warning: Could not find remote branch v0.0.1 to clone.
fatal: Remote branch v0.0.1 not found in upstream origin
) during validation.

[!] The spec did not pass validation, due to 1 error.

看到关键的一行:

fatal: Remote branch v0.0.1 not found in upstream origin

这里因为从远端拉不到v0.0.1branch而引起的报错。

报错的原因

在这里之前,首次发布开源项目到spec,我们应该先加上:

git tag 'v0.0.1'

如果没有加上就会出现上面的报错。

或者,当我们不小心少写了一个v,而写成:

git tag '0.0.1'

那么,不好意思,还是报错了!

解决办法

添加上:

git tag 'v0.0.1'

新的问题

正准备发布最新开源项目:HYBHelperKit,但是项目中有很多个目录,然后每个目录对应有一个.h文件来包括所有的头文件,最后再添加到HYBHelperKit.h头文件中。

在发布到spec时,一直不能通过验证,提示:

Validating podspec
 -> HYBHelperKit (0.0.1)
    - ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code. You can use `--verbose` for more information.
    - NOTE  | xcodebuild:  Headers/Public/HYBHelperKit/HYBHelperKit.h:15:9: fatal error: 'HYBHelperConstants.h' file not found

[!] The spec did not pass validation, due to 1 error.

当注释掉HYBHelperConstants.h后,又会出现另一个不能通过验证。这个是没有.m文件的,用于引入头文件!


承接:ThinkPHP项目开发、网站项目开发、微信项目开发、微信小程序项目开发、App开发,欢迎联系标哥QQ632840804