美文网首页
React Native ios运行报错

React Native ios运行报错

作者: 阿拉斌 | 来源:发表于2020-05-25 17:06 被阅读0次

周末因为MAC没电,所以一直都没折腾IOS的运行。今天充电了就赶紧试一下。

结果,一运行就报错:

> AwesomeProject@0.0.1 ios /Users/allahbin/ReactNativeProject/AwesomeProject
> react-native run-ios

error Could not find "Podfile.lock" at /Users/allahbin/ReactNativeProject/AwesomeProject/ios/Podfile.lock. Did you run "pod install" in iOS directory?
info Found Xcode project "AwesomeProject.xcodeproj"
info Building (using "xcodebuild -project AwesomeProject.xcodeproj -configuration Debug -scheme AwesomeProject -destination id=EC0DFD10-3FBB-41E1-87A9-CDED2ED40625")
.................
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening AwesomeProject.xcodeproj. Run CLI with --verbose flag for more details.
Command line invocation:

上面写了,Did you run "pod install" in iOS directory,好吧,很听话的去ios目录输入了pod install

然后就报错。。。

太难了。。。

反正拿着那个错误,大部分都是让去改Podfile这个文件,也就是这个

截屏2020-05-25 下午4.56.46.png

https://gitee.com/mirrors/CocoaPods-Specs

怎么改呢,直接在上面加一个码云的git地址,你要是觉得你的网好,你可以试试GitHub的。反正我是放弃了,这个太浪费我时间了。

截屏2020-05-25 下午4.57.18.png

之后,就慢慢等,它就会开始拉取代码,我们可以在这个目录看到拉取的项目


截屏2020-05-25 下午4.58.34.png

对了还会因为网不好出现这个错误:

[!] Error installing Folly
[!] /usr/local/bin/git clone https://github.com/facebook/folly.git /var/folders/_9/pc7kyd5n3fj700fn3f04knhm0000gn/T/d20200525-88019-dr8xzy --template= --single-branch --depth 1 --branch v2018.10.22.00

正克隆到 '/var/folders/_9/pc7kyd5n3fj700fn3f04knhm0000gn/T/d20200525-88019-dr8xzy'...
error: RPC 失败。curl 18 transfer closed with outstanding read data remaining
fatal: 远端意外挂断了
fatal: 过早的文件结束符(EOF)
fatal: index-pack 失败

没事,不断的重复就是了,不停的重复,直到结束。

allahbin@localhost ios % pod install
Analyzing dependencies
Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`
Fetching podspec for `Folly` from `../node_modules/react-native/third-party-podspecs/Folly.podspec`
Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec`
Downloading dependencies
Installing CocoaAsyncSocket (7.6.4)
Installing CocoaLibEvent (1.0.0)
Installing DoubleConversion (1.1.6)
Installing FBLazyVector (0.62.2)
Installing FBReactNativeSpec (0.62.2)
Installing Flipper (0.33.1)
Installing Flipper-DoubleConversion (1.1.7)
Installing Flipper-Folly (2.2.0)
Installing Flipper-Glog (0.3.6)
Installing Flipper-PeerTalk (0.0.4)
Installing Flipper-RSocket (1.1.0)
Installing FlipperKit (0.33.1)
Installing Folly (2018.10.22.00)
Installing OpenSSL-Universal (1.0.2.19)
Installing RCTRequired (0.62.2)
Installing RCTTypeSafety (0.62.2)
Installing React (0.62.2)
Installing React-Core (0.62.2)
Installing React-CoreModules (0.62.2)
Installing React-RCTActionSheet (0.62.2)
Installing React-RCTAnimation (0.62.2)
Installing React-RCTBlob (0.62.2)
Installing React-RCTImage (0.62.2)
Installing React-RCTLinking (0.62.2)
Installing React-RCTNetwork (0.62.2)
Installing React-RCTSettings (0.62.2)
Installing React-RCTText (0.62.2)
Installing React-RCTVibration (0.62.2)
Installing React-cxxreact (0.62.2)
Installing React-jsi (0.62.2)
Installing React-jsiexecutor (0.62.2)
Installing React-jsinspector (0.62.2)
Installing ReactCommon (0.62.2)
Installing Yoga (1.14.0)
Installing YogaKit (1.18.1)
Installing boost-for-react-native (1.63.0)
Installing glog (0.3.5)
Generating Pods project
Integrating client project

[!] Please close any current Xcode sessions and use `AwesomeProject.xcworkspace` for this project from now on.
Pod installation complete! There are 47 dependencies from the Podfile and 37 total pods installed.

然后就成功运行,可以愉快的玩耍了

相关文章

网友评论

      本文标题:React Native ios运行报错

      本文链接:https://www.haomeiwen.com/subject/kpnyahtx.html