简体   繁体   English

构建失败,出现异常 react-native

[英]Build failed with an exception react-native

got this error when running this command react-native run-android运行此命令时出现此错误 react-native run-android

I even tried so many things to deal with this like degrade your Java SDK version from 13 to 11, but nothing solved the issue.我什至尝试了很多方法来处理这个问题,比如将你的 Java SDK 版本从 13 降级到 11,但没有解决这个问题。

here is the information about the error.这是有关错误的信息。

  • Where: Build file 'G:\react\react-native\albums\android\app\build.gradle'其中:构建文件“G:\react\react-native\albums\android\app\build.gradle”

  • What went wrong: Could not compile build file 'G:\react\react-native\albums\android\app\build.gradle'.出了什么问题:无法编译构建文件“G:\react\react-native\albums\android\app\build.gradle”。

    startup failed: General error during semantic analysis: Unsupported class file major version 57启动失败:语义分析期间的一般错误:不支持 class 文件主要版本 57

Thank you in advance.先感谢您。

It is an issue with the jdk version.这是jdk版本的问题。 Kindly share your gradle You can try to check your classpath in the gradle build file and update the latest version(3.5.0).请分享您的 gradle 您可以尝试在 gradle 构建文件中检查您的类路径并更新最新版本(3.5.0)。 The latest jdk versions(11,12 and 13) works fine with the latest android plugin(3.5.0).最新的 jdk 版本(11,12 和 13)与最新的 android 插件(3.5.0)配合良好。 3.5.1 is already out but has issues too. 3.5.1 已经发布,但也有问题。 I would prefer 3.5.0 for now.我现在更喜欢 3.5.0。

classpath 'com.android.tools.build:gradle:3.5.0'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM