照着这个教程来即可,这是我看到最好用的教程
//www.greatytc.com/p/f433a931a4c1
另附上本地私有库链接//www.greatytc.com/p/00983e2a771c
那么我这篇文章的意义在哪呢?意义是记录一下我踩的坑,但是你不一定会遇到的哦。
一.第六步验证spec文件遇到的问题
1. Could not find a ios
simulator, Ensure that Xcode -> Window -> Devices has at least on
解决方法:升级cocoapods即可,即终端输入:
sudo gem install cocoapods
2. ERROR | [iOS] file patterns: The source_files pattern did not match any file.
这个问题最基本的是podspec中source_files路径配置有误,如果确实没有问题请参考如下方法,百发百中:
解决方法
二.第六步提交远程仓库遇到的问题
这个问题和第四步有关,因为我勾选了使用readme初始化导致的问题。如果你操作第四步的时候照下图配置创建应该不会出现
图片.png
当我执行的时候
$ git push origin master (提交到远程仓库)
报错了,如图
图片.png
原因就是我远程仓库勾选了使用readme初始化,然后远程仓库会有一个readme文件,然后我git push的时候本地根本没有readme问题,两个仓库不同步。解决方法:终端依次输入
git pull --rebase origin master
git add .
git rebase --continue
此时再执行提交远程仓库命令即可,即
git push origin master
三.第八步中Podfile中的source是spec的git地址,不是私有库的地址,不然报错
[!] An unexpected version directory `Assets` was encountered for the `/Users/nimo/.cocoapods/repos/xxxx` Pod in the `xxxx` repository.
参考地址:
https://www.cnblogs.com/yiduobaozhiblog1/p/9125465.html
https://blog.csdn.net/dake_160413/article/details/78676163
//www.greatytc.com/p/9b45cb547f39