xcode路径的改变导致的cocoapods编译失败或者xcrun: error: active developer path ("/Applications/Xcode.app/Contents/D

这几天心血来潮,更新了下Mac系统,然后装了下Xcode10装逼,(原先Xcode9.0是同事下载,为了省时间直接通过隔空投送传过来的)接下来就懵逼了。
接着我就直接熟练的使用cocoapods(10.0的Xcode要升级系统,对应的cocoapods一定要升级,不然也无法使用cocoapods),巴拉巴拉巴拉然后再 pod install,接下来就懵逼了。。。。
报如下错误:

Setting up CocoaPods master repo
$ /usr/bin/git remote set-url origin https://github.com/CocoaPods/Specs.git
xcrun: error: active developer path ("/Applications/Xcode.app/Contents/Developer") does not exist, use xcode-select --switch path/to/Xcode.app to specify the Xcode that you wish to use for command line developer tools (or see man xcode-select)
[!] Failed: /usr/bin/git remote set-url origin https://github.com/CocoaPods/Specs.git
$ /usr/bin/git checkout master
xcrun: error: active developer path ("/Applications/Xcode.app/Contents/Developer") does not exist, use xcode-select --switch path/to/Xcode.app to specify the Xcode that you wish to use for command line developer tools (or see man xcode-select)
[!] Failed: /usr/bin/git checkout master
[!] Unable to add a source with url https://github.com/CocoaPods/Specs.git named master-1.
(The master repo is not a git repo.)
You can try adding it manually in ~/.cocoapods/repos or via pod repo add.
试了几次都不行,又换pod update还是不行,于是我开始怀疑是不是COcoaPods炸了,还是我升级了系统之后炸了。。。。想想不科学,应该是XCode的问题,仔细阅读错误(原谅我英文差),貌似看懂了那么一点,可能是我删了XCode又恢复导致的。就这么一百度果然还真是的。
一句命令搞定:sudo xcode-select --switch /Applications/Xcode.app(后面的地址直接打开程序把Xcode往这里拖即可)。完事后再pod install。。biubiubiu出现了熟悉的“Analyzing dependencies”字样,最后提示“Pod installation complete! There are 15 dependencies from the Podfile and 16 total pods installed.”。ok成功了。
以上记录我遇到的坑爹错误,给初次遇到这样问题的童鞋一点思路,不至于搓手不急(当时CocoaPods不能用我心中一万个草泥马崩腾啊)

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值