Issue when creating my first CocoaPod

纵然是瞬间 提交于 2019-12-30 03:41:20

问题


I am trying to create my first pod and is following this tutorial: http://www.sitepoint.com/creating-cocoapods/

But when I do:

pod spec lint GLLingoManager.podspec

I get following error:

$ pod spec lint GLLingoManager.podspec

 -> GLLingoManager (0.1.0)
    - ERROR | [OSX] unknown: Encountered an unknown error ([!] /Applications/Xcode.app/Contents/Developer/usr/bin/git clone https://github.com/xeppen/GLLingoManager.git /var/folders/v6/tdz6zc7j10j_k0pc1vy627zm0000gn/T/d20160504-76297-8l71fj --template= --single-branch --depth 1 --branch 0.1.0

Cloning into '/var/folders/v6/tdz6zc7j10j_k0pc1vy627zm0000gn/T/d20160504-76297-8l71fj'...
warning: Could not find remote branch 0.1.0 to clone.
fatal: Remote branch 0.1.0 not found in upstream origin
) during validation.

Analyzed 1 podspec.

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

I dont understand what is wrong. What should I do?


回答1:


Add a 0.1.0 version for your github repo. Image from Github incase the link dies:




回答2:


You have pointed to a branch called 0.1.0 in your podspec, and you simply need to push a branch of that name to github. Many people use tags instead of branches to indicate which commit to use for each pod version, and I suggest that you do this instead of pointing to a branch. Please post the source section of your podspec for more specific details.




回答3:


You can also add a tag to your branch in terminal:

git tag 0.1.0
git push --tags



回答4:


Sometimes the following command line will create a problem, if you are copy pasting into terminal.

Example

//incorrect
git tag ‘0.1.0’
//Will create a tag ‘0.1.0’

//correct
git tag '0.1.0'
//will create a tag 0.1.0

So better to type the single quotes, it may prevent this kind of unexpected issues. And go check your repo whether these tags are created properly.



来源:https://stackoverflow.com/questions/37038659/issue-when-creating-my-first-cocoapod

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!