Griffon error Could not find property 'compileOnly' on configuration - gradle

I try to create a Griffon application as described at
http://griffon-framework.org/tutorials/1_getting_started.html#_tutorial_1_2
Using:
Gradle 2.9
lazybones 0.8.3
mvn 3.3.9
Entered:
lazybones create griffon-swing-java sample
Define value for 'group' [org.example]:
Define value for 'artifactId' [sample]:
Define value for 'version' [0.1.0-SNAPSHOT]:
Define value for 'griffonVersion' [2.7.0]:
Define value for 'package' [org.example]:
Define value for 'className' [Sample]:
Project created in sample!
cd sample
gradle run
Gives this error:
FAILURE: Build failed with an exception.
* Where:
Script '/home/username/dev/griffon_prj/sample/gradle/integration-test.gradle' line: 20
* What went wrong:
A problem occurred evaluating script.
> Could not find property 'compileOnly' on configuration container.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Am I missing something?

It sounds like a gradle configuration/script error, the gradle 2.9 version could the be problem, the tutorial mentions 2.14.
IMHO you should install gradle 2.14.1, it works fine.
I followed this tutorial and did a groovy-swing app without any problem with lazybones 0.8.3 and gradle 2.14.1.
You can have several gradle installations, each one in it's own directory, without any problem, just to take care of the path and GRADLE_HOME if you use command line (you will for the tuto).

Related

Nativescript Android build fails suddenly (NS6)

My Nativescript 6 Android build suddenly is failing - I didn't update any modules except for the NS CLI 8.2.3 - but the tns-android is 6.5.x
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/mini/Projects/app-mobile/platforms/tempPlugin/nativescript_webview_ext/build.gradle' line: 6
* What went wrong:
A problem occurred evaluating root project 'nativescript_webview_ext'.
> Failed to apply plugin 'com.android.internal.library'.
> Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.
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`.
* 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 684ms
Failed to build plugin #nota/nativescript-webview-ext :
Error: Command ./gradlew failed with exit code 1
Again this was working before the CLI update.
I'm using Java 1.8 - seems to be a big jump to Java 11.
Failed to apply plugin 'com.android.internal.library'.
Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.
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`.
As it can be read from the error message, gradle is expecting jdk 11 and you have jdk 8 configured. Install jdk 11 on the system and set JAVA_HOME environment variable to point to it.
This is probably happening because nativescript 8.2.3 seems to be using gradle 7 and it expects jdk 11. You can specify gradle version in a somewhat hacky way likewise:
How can I downgrade the Gradle in NativeScript?

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:

Minecraft Forge Gradle with VSCode

I am trying to create a Minecraft Mod using VSCode as this is my main editor for school, but when I try to run the command gradlew genVSCodeRun I get the follwoing output that says successful, but also "Could not resolve: net.minecraftforge:forge:1.15.2-31.1.0_mapped_snapshot_20190719-1.14.3". When I then run gradlew build, the following it output:
Task :compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all files for configuration ':compileClasspath'.
Could not find net.minecraftforge:forge:1.15.2-31.1.0_mapped_snapshot_20200119-1.14.3.
Searched in the following locations:
- file:/C:/Users/eabla/.gradle/caches/forge_gradle/bundeled_repo/net/minecraftforge/forge/1.15.2-31.1.0_mapped_snapshot_20200119-1.15/forge-1.15.2-31.1.0_mapped_snapshot_20200119-1.14.3.pom
- file:/C:/Users/eabla/.gradle/caches/forge_gradle/bundeled_repo/net/minecraftforge/forge/1.15.2-31.1.0_mapped_snapshot_20200119-1.15/forge-1.15.2-31.1.0_mapped_snapshot_20200119-1.14.3.jar
- https://files.minecraftforge.net/maven/net/minecraftforge/forge/1.14.3.2-31.1.0_mapped_snapshot_20200119-1.14.3/forge-1.14.3.2-31.1.0_mapped_snapshot_20200119-1.14.3.pom
- https://files.minecraftforge.net/maven/net/minecraftforge/forge/1.14.3.2-31.1.0_mapped_snapshot_20200119-1.14.3/forge-1.14.3.2-31.1.0_mapped_snapshot_20200119-1.14.3.jar
- https://libraries.minecraft.net/net/minecraftforge/forge/1.14.3.2-31.1.0_mapped_snapshot_20200119-1.14.3/forge-1.14.3.2-31.1.0_mapped_snapshot_20200119-1.14.3.jar
- https://repo.maven.apache.org/maven2/net/minecraftforge/forge/1.14.3.2-31.1.0_mapped_snapshot_20200119-1.14.3/forge-1.14.3.2-31.1.0_mapped_snapshot_20200119-1.14.3.pom
- https://repo.maven.apache.org/maven2/net/minecraftforge/forge/1.14.3.2-31.1.0_mapped_snapshot_20200119-1.14.3/forge-1.14.3.2-31.1.0_mapped_snapshot_20200119-1.14.3.jar
Required by:
project :
* 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
Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/4.9/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 40s
1 actionable task: 1 executed
Any idea what this could be? I have done a fresh install of java JDK and JRE as well as a fresh install of the Forge MDK.
Your Forge Library is missing. Run the command gradlew eclipse after navigating into your project directory. It may take some time but it will surely fix it. :D
Make sure you have the JDK (java development kit https://www.oracle.com/java/technologies/javase-jdk8-downloads.html) installed not just the JRE

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.

Android studio build error

Tried to create my first project in android studio, using one of the examples im trying to run the application, but gradle gives me this build error (didnt change one line of code - just trying to run the Empty activity):
Gradle: FAILURE: Build failed with an exception.
* What went wrong: Execution failed for task ':Passivelocation:packageDebug'.
org.bouncycastle.asn1.ASN1Integer.(J)V
* Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Ive tried adding info and debug while running the command on with the cli but i cant make much of the output it gives me.
Any suggestions?
I faced the same failure and the problem was with my jdk/jre because some time ago I added the Bouncy Castle Crypto APIs functionality by adding the jar to my jdk/jre path.
I tried a gradle build with a "clean" jdk/jre and problem was solved

Resources