React Native搭建開發(fā)環(huán)境遇到的問(wèn)題
cd AwesomeProject
yarn ios
# 或者
yarn react-native run-ios
此時(shí),遇到了問(wèn)題,顯示"Installing CocoaPods dependencies failed"
系統(tǒng)提示我們進(jìn)入AwesomeProject->ios項(xiàng)目文件下,單獨(dú)的pod install
但此時(shí)遇到了錯(cuò)誤如下
[!] CocoaPods could not find compatible versions for pod "FlipperKit/FlipperKitReactPlugin":
In Podfile:
FlipperKit/FlipperKitReactPlugin (~> 0.33.1)
None of your spec sources contain a spec satisfying the dependency: `FlipperKit/FlipperKitReactPlugin (~> 0.33.1)`.
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.
[!] CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/ Response: 400
Step 1 : Remove trunk
pod repo remove master
Step 2 : 下載cocoaPods倉(cāng)庫(kù)到本地,下載速度可能會(huì)不穩(wěn)定累榜,有時(shí)候可能會(huì)出現(xiàn)下載不了的情況
git clone https://github.com/CocoaPods/Specs.git ~/.cocoapods/repos/master
Step 3 : 打開podfile,在第一行加上源文件
source 'https://github.com/CocoaPods/Specs.git'
Step4 : pod install