React native搭建環境遇到的問題

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

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。