React Native报错总结

特别声明:react native坑太多,可能每个版本对应的环境都不一样,现使用环境配置如下

react native0.64.0
java JDK 1.8
Android Studio 4.1
CocoaPods 1.10.1
问题:1

React Native报错总结_第1张图片

* Where:
Build file '/Users/xxxx/Desktop/zxcz/zxrn1/AwesomeProject5/android/build.gradle'

* What went wrong:
Could not compile build file '/Users/xxxxx/Desktop/zxcz/zxrn1/AwesomeProject5/android/build.gradle'.
> startup failed:
  General error during semantic analysis: Unsupported class file major version 60

Gradle error: Could not initialize class org.codehaus.groovy.runtime.InvokerHelper

解决方法:查看你的java 版本是不是过高或者过低,最好是删除原有的版本,安装1.8版本的java sdk

问题:2

如果使用Android Studio 打开 android文件夹出现以下报错

This version of the Android Support plugin for IntelliJ IDEA (or AndroidStudio)

解决方法:请更新你的Android Studio到最新版本

问题:3

ReactNative遇到info Installing required CocoaPods dependencies卡死的问题

解决方法:淡定等他结束,应该会提示你cd 项目/ios执行pod install,这个时候应该会出现安装失败,请求超时等各种报红。在报错以后淡定的重新执行pod install直到完全拉取完毕

除非你有超级牛逼的科学工具,可以一次走完,不然就多等待一会吧

问题:4

如果出现如下报错信息

[!] Oh no, an error occurred.

Search for existing GitHub issues similar to yours:
https://github.com/CocoaPods/CocoaPods/search?q=%5BXcodeproj%5D+Unknown+object+version.&type=Issues

If none exists, create a ticket, with the template displayed above, on:
https://github.com/CocoaPods/CocoaPods/issues/new

Be sure to first read the contributing guide for details on how to properly submit a ticket:
https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md

Don't forget to anonymize any private data!

Looking for related issues on cocoapods/cocoapods...

直接更新cocoaPods到最新版本,如果你用的是mac,可以执行下属命令

brew update 

但是注意看这个执行完以后会出现一个建议命令,一定要执行,它会把你当前电脑环境下一些环境都会更新到最新的版本,更新完以后再次执行pod install

按时先整理这么多吧,遇见了在加

你可能感兴趣的:(react,native,react,native)