Cocoapods安装各种坑及解决方案

CocoaPods使用中遇到的问题(警告⚠️和错误❗️)

2019-06-25  本文已影响0人  Helson
CocoaPods Logo

警告⚠️

1.问题:警告如下

[!] Smart quotes were detected and ignored in your Podfile. To avoid issues in the future, you should not use TextEdit for editing it. If you are not using TextEdit, you should turn off smart quotes in your editor of choice.

警告原因:因为Podfile文件里使用了中文的双引号。😂
解决办法:当然是检查Podfile文件里有没有中文的符号,改为英文符号。然后重新执行pod install。以后修改Podfile文件的时候注意就OK了。

错误❗️

1.问题:该错误出现在组件化过程中在主项目的Podfile里面加入pod '组件名'。一顿操作命令行:pod install,然后GG。报错如下:

Analyzing dependencies
[!] Unable to find a specification for `组件名`

You have either:
 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.

Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default.

错误原因:上面一定给出来了我这里主要是因为:not added the source repo that hosts the Podspec to your Podfile..

解决办法:在项目的Podfile里添加组件的source地址。然后再重新pod install就搞定了。

source 'https://github.com/<你的用户名>/<你的仓库名>.git'(这个是自己建立的索引库,你要用自己的索引库)
source '[https://github.com/CocoaPods/Specs.git](https://github.com/CocoaPods/Specs.git)'

今后会持续更新······

上一篇下一篇

猜你喜欢

热点阅读