1、Could not automatically select an Xcode workspace
- 錯(cuò)誤提示:
Could not automatically select an Xcode workspace. Specify one in your Podfile like so:
workspace 'path/to/Workspace.xcworkspace'
xcodeproj 'path/to/Project.xcodeproj'
- 解決方法:
1、在終端通過(guò)cd命令切換路徑到Podfile文件所在目錄
2、編輯Podfile:XXX為工程名,下面是自己引入的類庫(kù)
target 'XXX' do
pod 'AFNetworking', '~> 3.0'
end
3、在終端輸入命令 pod install ?或者 pod update
- 注意:
Podfile文件要放在XXX.xcodeproj和XXX.xcworkspace同一目錄下。
2、The `master` repo requires CocoaPods 0.18.1
- 錯(cuò)誤提示:
The `master` repo requires CocoaPods 0.18.1 -
Update Cocoapods, or checkout the appropriate tag in the repo.
沒(méi)有更新到最新的Cocoapods版本
解決方法:
更新 CocoaPods :
$ [sudo] gem update cocoapods
如果你想嘗試一個(gè)預(yù)發(fā)布版本的CocoaPods可以運(yùn)行:
$ [sudo] gem update cocoapods --pre參考鏈接:Updating CocoaPods
3、Errno::EPERM - Operation not permitted
- 錯(cuò)誤提示:
Errno::EPERM - Operation not permitted - /Users/../Pods/Pods.xcodeproj/xcuserdata/root.xcuserdatad
- 解決方法:
在終端運(yùn)行:
sudo gem install -n /usr/local/bin cocoapods
4、The dependency `AFNetworking (~> 3.1.0)` is not used in any concrete target.
- 錯(cuò)誤提示:
The dependency `AFNetworking (~> 3.1.0)` is not used in any concrete target.
- 解決方法:
添加 target名,如下:
target 'XXX' do
pod 'AFNetworking'
end
其中XXX要換成當(dāng)前 target名,最后不要忘記增加一個(gè) end 結(jié)尾。
然后重新進(jìn)行
pod install
5、安裝或更新第三方庫(kù)時(shí)出現(xiàn)警告:Your Podfile has had smart quotes sanitised
Your Podfile has had smart quotes sanitised. 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 文件里面有部分引號(hào)不合法,不要使用文本編輯。
注意:Podfile 文件里面引號(hào)應(yīng)該是 ',而不是 ‘。注意區(qū)分。
1、不要使用文本編輯去編輯
Podfile文件,使用Xcode編輯,或者使用終端敲命令去編輯。2、
Podfile的內(nèi)容語(yǔ)法格式有問(wèn)題。