React native搭建环境遇到的问题

2020-05-26  本文已影响0人  SmileYang966

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

上一篇下一篇

猜你喜欢

热点阅读