9

Task :react-native-gradle-plugin:compileKotlin FAILED 'compileJava' task (current target is 1.8) and 'compileKotlin' task (current target is 11) jvm target compatibility should be set to the same Java version. 1 actionable task: 1 executed

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':react-native-gradle-plugin:compileKotlin'.

Failed to query the value of task ':react-native-gradle-plugin:compileKotlin' property 'compilerRunner$kotlin_gradle_plugin'. Kotlin could not find the required JDK tools in the Java installation. Make sure Kotlin compilation is running on a JDK, not JRE.

  • 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.

BUILD FAILED in 31s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':react-native-gradle-plugin:compileKotlin'.

Failed to query the value of task ':react-native-gradle-plugin:compileKotlin' property 'compilerRunner$kotlin_gradle_plugin'. Kotlin could not find the required JDK tools in the Java installation. Make sure Kotlin compilation is running on a JDK, not JRE.

3
  • 2
    Have you resolved this issue? Commented Jun 3, 2022 at 11:13
  • Bro have you solved this issue? Commented Jul 5, 2022 at 14:07
  • 3
    My project was working fine yesterday, today I got this issue out of nowhere without making any changes :( Commented Jul 13, 2022 at 9:09

3 Answers 3

0

Download and install JDK you can check this link for more help: https://github.com/Jire/Charlatano/issues/854

Sign up to request clarification or add additional context in comments.

Comments

0

Try:

rm -rf ./node_modules
yarn
npm run android

1 Comment

update current jdk 11+
0

All you had to upgrade the gradle, go to android/gradle/wrapper/gradle-wrapper.properties and change the distributionUrl to distributionUrl=https://services.gradle.org/distributions/gradle-8.1.1-all.zip

if it doesn't work just check the current version of the gradle in the link https://gradle.org/releases/ and replace with the gradle version in distributionUrl property.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.