CocoaPods更新第三方库出错的解决办法

转载自:

https://www.jianshu.com/p/0e3421961db4

执行完pod install之后,控制台抛出以下警告信息:

[!] The use of implicit sources has been deprecated. To continue using all of the sources currently on your machine, add the following to the top of your Podfile:

source 'https://github.com/CocoaPods/Specs.git'

[!] The `ProjectName [Debug]` target overrides the `OTHER_LDFLAGS` build setting defined in `Pods/Target Support Files/Pods/Pods.debug.xcconfig'. This can lead to problems with the CocoaPods installation

[!] The `ProjectName [Release]` target overrides the `OTHER_LDFLAGS` build setting defined in `Pods/Target Support Files/Pods/Pods.release.xcconfig'. This can lead to problems with the CocoaPods installation

.debug.xcconfig丢失

如果不解决此问题的话,会出现由于部分库文件找不到而导致的种种问题:

(1)编译失败,抛出Undefined symbols for architecture i386错误

(2)调用库中的方法,抛出unrecognized selector sent to instance错误

?

解决方法如下:

1、打开工程所在文件夹,找到.xcodeproj文件,右键选择【显示包内容】,找到project.pbxproj文件

2、打开project.pbxproj文件,查找OTHER_LDFLAGS,把和这个相关的内容都删除

3、重新执行pod install,此时应该就没有上面出现的警告信息了

4、编译并运行

问题二:

3、

$ pod setup

Setting up CocoaPods master repo

[!] /usr/bin/git clonehttps://github.com/CocoaPods/Specs.git master

Cloning into ‘master’…

error: RPC failed; curl56 SSLRead()return error -9806

fatal: The remote end hung up unexpectedly

fatal: early EOF

fatal: index-pack failed

4、

$ pod setup

Setting up CocoaPods master repo

[!] /usr/bin/git clonehttps://github.com/CocoaPods/Specs.git master

Cloning into ‘master’…

error: RPC failed; curl18 transfer closed with outstanding read data remaining

fatal: The remote end hung up unexpectedly

fatal: early EOF

fatal: index-pack failed

解决方法:上面错误主要是os10.11+和cocoapods1.0+版本升级的安全机制更改造成的。主要出现在pod setup过程中。且该过程等待时间非常长,所以,你可以在$sudo gem install -n /usr/local/bin cocoapods命令后直接执行$Git clone https://git.coding.net/CocoaPods/Specs.git ~/.cocoapods/repos/master 该过程作用与 pod setup作用相同,作者亲测。效果极佳!!!!

如果还不成功!!!!可以同样的方法安装正式版v0.39 然后在升级到v1.0版本

gem update --system

sudo geminstall -n /usr/local/bin cocoapods--pre


 

猜你喜欢

转载自blog.csdn.net/parasoft/article/details/84308172