Home > Software design >  React-Native AppCenter ERROR: requires JDK11 or higher. Incompatible major version detected: '8
React-Native AppCenter ERROR: requires JDK11 or higher. Incompatible major version detected: '8

Time:06-20

i am getting this error when trying to build reactnative app in the cloud (https://appcenter.ms)

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

any idea on how to resolve this please?

full log:

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://docs.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

CodePudding user response:

Install the JDK11 first, then follow the answer in react-native repo issues.

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

Or Check the below thread

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

  • Related