unity gradle build failed could not resolve launcher:classpath - visual-studio

When i want to build project in unity 2020.2.7 I see some error in building gradle as shown here:
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':launcher'.
> Could not resolve all artifacts for configuration ':launcher:classpath'.
> Could not find gradle.jar (com.android.tools.build:gradle:3.6.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.6.0/gradle-3.6.0.jar
> Could not find builder.jar (com.android.tools.build:builder:3.6.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/build/builder/3.6.0/builder-3.6
I tick the custom build gradle template in player Setting and changed the
classpath com.android.tools.build:gradle:5.6.4 as I use the unity 2020.2.7 but it doesn't solve the problem.
Added the JAVA_HOME in Environment variable and I use jdk 1.8.291. Can anyone help me?

Related

in my flutter app gradlew not giving signingReports what is reason after putting all the dependencies

* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin 'com.android.internal.application'.
You can try some of the following options:
- changing the IDE settings.
- changing the JAVA_HOME environment variable.
- changing `org.gradle.java.home` in `gradle.properties`.
what is the problem even after getting the plugins right

Could not resolve all files for configuration ':runtimeClasspathCopy'

I get folowing error as soon as I create a minecraft forge mod project for the minecraft version 1.18.2 with java sdk 17:
Could not resolve all files for configuration ':runtimeClasspathCopy'.
> Could not find net.minecraftforge:forge:1.18.2-40.1.25_mapped_official_1.18.2.
Searched in the following locations:
- file:/C:/Users/Hendrik/.gradle/caches/forge_gradle/bundeled_repo/net/minecraftforge/forge/1.18.2-40.1.25_mapped_official_1.18.2/forge-1.18.2-40.1.25_mapped_official_1.18.2.pom
- file:/C:/Users/Hendrik/.gradle/caches/forge_gradle/bundeled_repo/net/minecraftforge/forge/1.18.2-40.1.25_mapped_official_1.18.2/forge-1.18.2-40.1.25_mapped_official_1.18.2.jar
Required by:
project :
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
The given documentation also doon't realy helpes.
Maybe it's a problem with your cache, so deleted it from
C:\Users\Hendrik\.gradle\caches\forge_gradle
and rerun genEclipseRuns

Build the project using gradle

I have so far used maven to build the java code.
I was trying to build this project which is using gradle: https://github.com/opendistro-for-elasticsearch/anomaly-detection
I followed the below steps and it is failing continuously in build.
After cloning the code,
Step 1: As per the steps mentioned in the link, I installed java first and set the Java home and path like below
yum install java-1.8.0-openjdk
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk
export PATH=$JAVA_HOME/bin:$PATH
Step 2 : I tried to build the project using gradlew like below and end up with the error,
anomaly-detection]# ./gradlew
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details
FAILURE: Build failed with an exception.
* Where:
Build file '/host/eclipse_back/opendistro/anomaly-detection/build.gradle' line: 55
* What went wrong:
A problem occurred evaluating root project 'opendistro-anomaly-detection'.
> Failed to apply plugin [id 'elasticsearch.esplugin']
> Could not create plugin of type 'PluginBuildPlugin'.
> Could not generate a decorated class for type PluginBuildPlugin.
> org/elasticsearch/gradle/plugin/PluginPropertiesExtension has been compiled by a more recent version of the Java Runtime (class file version 54.0), this version of the Java Runtime only recognizes class file versions up to 52.0
* 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 8s
Why it's failing? Any help is appreciated!
Thanks,
Harry
You need to setup your build environment for gradle to use a more recent java version. You can set the java version with the gradle property org.gradle.java.home:
org.gradle.java.home=<path to JDK home>
I think the problem is that you use Java 8 and in the README they want to use Java 14.
To build from command line set JAVA_HOME to point to a JDK 14 before running ./gradlew
Then it should be possible to build and test the project with the following command:
./gradlew build
EDIT:
Can you check your configuration of your IDE. Did the Gradle JVM use the correct Java version? If you are using Intellik you can check it following this post:

Gradle not more detail for ':compileKotlin'

I'm new on gradle and kotlin
When i build syntax error file using gradle build
it's just show
Execution failed for task ':compileKotlin'.
> Compilation error. See log for more details
How do i get which line syntax error like using kotlinc?
PS: using vscode, so i need it
edited
Sorry, i missed up error message because difference between gradle and kotlinc
gradle:
PS C:\PlayGround2> gradle build
e: C:\PlayGround2\src\main\kotlin\Main.kt: (26, 1): Expecting a top level declaration
> Task :compileKotlin
Using kotlin incremental compilation
...
kotlinc:
PS C:\PlayGround2\src\main\kotlin> kotlinc .\Main.kt
Main.kt:26:1: error: expecting a top level declaration
} <--- this line not shown in kotlinc
that's a known issue, someone has solved it by uninstalling all java versions and only install JDK 8.
edit: also check this link : https://github.com/waicool20/KAGA/issues/27
Have a nice day.

Could not create task of type 'ShadowJar'

I have this error:
ERROR
I checked my Eclipse preferences/Gradle, and the the Gradle directory is well set.
Besides, I have this stack error in my console when I try to refresh my project:
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\java\admin\build.gradle' line: 6
* What went wrong:
A problem occurred evaluating project ':admin'.
> Failed to apply plugin [class 'com.github.jengelman.gradle.plugins.shadow.ShadowJavaPlugin']
> Could not create task of type 'ShadowJar'.
Do you have any idea of what's happening here?
Thanks!
Gradle 2.11 breaks compatibility with shadowjar version 1.2.2. You can fix this by updating to shadowjar version 1.2.3.
Source: https://github.com/johnrengelman/shadow/commit/918a649b608f34dc0902d8d7aba21326ae5dfe8d

Resources