React Native搭建開發環境遇到的問題
cd AwesomeProject
yarn ios
# 或者
yarn react-native run-ios
此時,遇到了問題,顯示"Installing CocoaPods dependencies failed"
系統提示我們進入AwesomeProject->ios項目文件下,單獨的pod install
但此時遇到了錯誤如下
[!] 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倉庫到本地,下載速度可能會不穩定,有時候可能會出現下載不了的情況
git clone https://github.com/CocoaPods/Specs.git ~/.cocoapods/repos/master
Step 3 : 打開podfile,在第一行加上源文件
source 'https://github.com/CocoaPods/Specs.git'
Step4 : pod install