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

本文解决了在使用CocoaPods过程中遇到的两大问题:一是执行pod install后出现的警告信息,涉及Podfile中源配置和OTHER_LDFLAGS设置冲突;二是pod setup时的网络错误,提供了解决方案,包括修改Podfile和使用替代命令。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

转载自:

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


 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值