首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >反应-本机AppCenter错误:需要JDK11或更高版本。检测到不兼容的主要版本:“8”

反应-本机AppCenter错误:需要JDK11或更高版本。检测到不兼容的主要版本:“8”
EN

Stack Overflow用户
提问于 2022-06-19 06:21:37
回答 2查看 474关注 0票数 0

当我试图在云中构建反应型本机应用程序(https://appcenter.ms)时,我遇到了这个错误。

代码语言:javascript
复制
ERROR: requires JDK11 or higher.
Incompatible major version detected: '8'

请知道如何解决这个问题吗?

全日志:

代码语言:javascript
复制
Welcomenter code heree to Gradle 7.2!

Here are the highlights of this release:
 - Toolchain support for Scala
 - More cache hits when Java source files have platform-specific line endings
 - More resilient remote HTTP build cache behavior

For more details see https://docs.gradle.org/7.2/release-notes.html

Starting a Gradle Daemon (subsequent builds will be faster)
Gradle 7.2

> Configure project :
Resolved com.android.tools.build:gradle:4.2.2 in :classpath 
Project DevotionHub at : is either no Android app project or build version has not been set to override. Skipping...

> Configure project :app




**************************************************************************************************************



ERROR: requires JDK11 or higher.
Incompatible major version detected: '8'



**************************************************************************************************************





The message received from the daemon indicates that the daemon has disappeared.
Build request sent: Build{id=a4c936fe-dacd-4d69-b0cb-59e1fbc9d4ff, currentDir=/Users/runner/work/1/s}
Attempting to read last messages from the daemon log...
Daemon pid: 5439
  log file: /Users/runner/.gradle/daemon/7.2/daemon-5439.out.log
----- Last  20 lines from daemon log file - daemon-5439.out.log -----
Project DevotionHub at : is either no Android app project or build version has not been set to override. Skipping...




**************************************************************************************************************



ERROR: requires JDK11 or higher.
Incompatible major version detected: '8'



**************************************************************************************************************




Daemon vm is shutting down... The daemon has exited normally or was terminated in response to a *** interrupt.
----- End of the daemon log -----


FAILURE: Build failed with an exception.

* What went wrong:
Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org
Error: /Users/runner/work/1/s/android/gradlew failed with return code: 1
    at ChildProcess.<anonymous> (/Users/runner/work/_tasks/Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4/1.128.0/node_modules/vsts-task-lib/toolrunner.js:569:30)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:920:16)
    at Socket.<anonymous> (internal/child_process.js:351:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:509:12)
##[error]Error: /Users/runner/work/1/s/android/gradlew failed with return code: 1
##[section]Finishing: Gradle Task
##[section]Starting: Sign APK
==============================================================================
Task         : Android signing
Description  : Sign and align Android APK files
Version      : 3.201.0
Author       : Microsoft Corporation
Help         : https://learn.microsoft.com/azure/devops/pipelines/tasks/build/android-signing
==============================================================================
##[section]Finishing: Sign APK
##[section]Starting: Checkout devotionHub-mobileapp@test to s
==============================================================================
Task         : Get sources
Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
Version      : 1.0.0
Author       : Microsoft
Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
==============================================================================
Cleaning any cached credential from repository: devotionHub-mobileapp (ExternalGit)
##[section]Finishing: Checkout devotionHub-mobileapp@test to s
##[section]Starting: Finalize Job
Cleaning up task key
Start cleaning up orphan processes.
##[section]Finishing: Finalize Job
##[section]Finishing: Build
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2022-06-19 06:23:56

首先安装JDK11,然后按照react本机回购问题的答案执行。

https://github.com/facebook/react-native/issues/33731#issuecomment-1140252250

或检查下面的线程

https://github.com/microsoft/appcenter/issues/2067

票数 0
EN

Stack Overflow用户

发布于 2022-07-25 17:11:54

默认情况下安装JDK11。只需将环境变量JAVA_HOME设置为$(JAVA_HOME_11_X64)即可。构建配置

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72674678

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档