Issue with ./gradlew clean using react native android - java

Within my app, I run cd android and then ./gradlew clean.
I then get a BUILD FAILURE error:
FAILURE: Build failed with an exception.
* What went wrong:
Could not initialize class org.codehaus.groovy.runtime.InvokerHelper
* 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

FIXED.
I swapped the value of the distributionUrl within the gradle-wrapper.properties file with this value https\://services.gradle.org/distributions/gradle-6.3-all.zip
zipStoreBase=GRADLE_USER_HOME

Related

./gradle genSources exception with Java version

I have an exception when I write ./gradlew genSource in terminal.
* Where:
Build file 'C:\Users\Admin\Desktop\fabric-example-mod-1.19\build.gradle' line: 2
* What went wrong:
An exception occurred applying plugin request [id: 'fabric-loom', version: '0.12-SNAPSHOT']
> Failed to apply plugin 'fabric-loom'.
> You are using an outdated version of Java (8). Java 17 or higher is required.
The JAVA_HOME environment variable is currently set to (C:\Program Files\Eclipse Adoptium\jdk-8.0.332.9-hotspot\).
* 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
BUILD FAILED in 2s
I saw my version of Java is old, but when I go to File | Settings | Build, Execution, Deployment | Build Tools | Gradle and change the Gradle JVM to ProjectSDK and try again, nothing changes.
Java 17 was downloaded and my Gradle was successfully build. Version of fabric for Minecraft is 1.19.

Task :react-native-gradle-plugin:compileKotlin FAILED

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.
Get more help at https://help.gradle.org
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.
Download and install JDK
you can check this link for more help:
https://github.com/Jire/Charlatano/issues/854
Try:
rm -rf ./node_modules
yarn
npm run android

How do i set up java 16 on ubuntu 18.04

I am trying to make Minecraft mods with Fabric, but when I run ./gradlew genSources, I get this error:
FAILURE: Build failed with an exception.
* Where:
Build file '/home/andrew/Desktop/Minecraft Mods/TEST/build.gradle' line: 2
* What went wrong:
An exception occurred applying plugin request [id: 'fabric-loom', version: '0.8-SNAPSHOT']
> Failed to apply plugin 'fabric-loom'.
> You are using an outdated version of Java (11). Java 16 or higher is required.
* 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
BUILD FAILED in 701ms
I uninstalled java 11 and installed java 16 with the deb file from https://www.oracle.com/java/technologies/javase-jdk16-downloads.html. Once I do that, I get this error when running ./gradlew genSources:
ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.
How do I fix this? Here is the tutorial I am following: https://www.youtube.com/watch?v=_JZ7bnk3oiM

Could not determine java version from '15.0.1'

I try to upload my test package firebase App Distribution by using
./gradlew assembleAlphaDebug appDistributionUploadAlphaDebug code snippet through android studio terminal, 5 days before I updated my java version and then I have started getting this error. I have not come across any solution until now.
FAILURE: Build failed with an exception.
What went wrong:
Could not determine java version from '15.0.1'.
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.
If you are using Mac, follow these steps:
vi ~/.bash_profile
Add in JAVA_HOME path there
export JAVA_HOME=/opt/bdc/opt/jdk
Save :wq
Execute source ~/.bash-profile
Once done do echo $JAVA_Home
and try your next steps.

Java problem in PowerShell 'Could not determine jave version from '14'

I can't run the command .-gradlew setupDecomWorkspace in PowerShell, I get this error, help and thanks :)
FAILURE: Build failed with an exception.
What went wrong:
Could not determine java version from '14'.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
PS C:\Users\Green\Desktop\forge-1.12.2-14.23.5.2768-mdk>

Categories