Cannot package Grails 3 application - NoSuchMethodError - java

I'm trying to package my Grails 3.1.5 application.
Running grails package (or grails war) results in the following:
FAILURE: Build failed with an exception.
* What went wrong:
org.codehaus.groovy.runtime.DefaultGroovyMethods.each(Ljava/util/List;Lgroovy/lang/Closure;)Ljava/util/List;
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 2.205 secs
| Error Command [package] error: Could not execute build using Gradle distribution 'https://services.gradle.org/distributions/gradle-2.6-bin.zip'. (Use --stacktrace to see the full trace)
Running with --stacktrace gives:
Caused by: java.lang.NoSuchMethodError: org.codehaus.groovy.runtime.DefaultGroovyMethods.each(Ljava/util/List;Lgroovy/lang/Closure;)Ljava/util/List;
at asset.pipeline.gradle.AssetCompile.getSource(AssetCompile.groovy:188)
at asset.pipeline.gradle.AssetCompile_Decorated.getSource(Unknown Source)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$PropertyInfo$4.create(AnnotationProcessingTaskFactory.java:460)
at org.gradle.util.SingleMessageLogger.whileDisabled(SingleMessageLogger.java:166)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$PropertyInfo.getValue(AnnotationProcessingTaskFactory.java:458)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$Validator$1.call(AnnotationProcessingTaskFactory.java:262)
My versions are:
| Grails Version: 3.1.5
| Groovy Version: 2.4.6
| JVM Version: 1.8.0_91
I've removed the .gradle cache folder, run a grails clean, but no luck.
Edit: My current solution is to use gradle to build the war; gradle war produces an uber-jar under build that I can use for deployments. Would sure by nice to use grails for this (unless I'm missing something).

I have worked around this by using:
./gradlew clean assemble
This produces a WAR in ./build/libs/.
It's possible this is caused by a bug on in Grails, as discussed here.

In my case, this error cropped up when using an older grails wrapper (grailsw) file. The solution was to use gradlew and the Grails CLI in my path, instead of using the old grailsw.

Related

how to fix "gradlew genSources"

I'm on windows 10, when I do "gradlew genSources" then this happened
Starting a Gradle Daemon, 7 stopped Daemons could not be reused, use --status for details
> Configure project :
Fabric Loom: 0.10.66
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\user\Downloads\MCJAVA\vector-addon\build.gradle'
* What went wrong:
Could not compile build file 'C:\Users\user\Downloads\MCJAVA\vector-addon\build.gradle'.
> startup failed:
General error during conversion: Unsupported class file major version 62
java.lang.IllegalArgumentException: Unsupported class file major version 62
1 error
* 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 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.2/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 5s
I want to know how can i fix it and im not good at coding and my english is not that good, I still tried with --stacktrace it still have similir error please help me
(its have a lot more text in code but its too much and i dont think it important)

I'm trying to build a Nativescript (angular) app and ran tns run android but unfortunately, I keep getting this build error

Full error:
FAILURE: Build failed with an exception.
Where:
Build file 'C:\Users\romario\git\trials\meo\platforms\tempPlugin\core\build.gradle' line: 6
What went wrong:
A problem occurred evaluating root project 'core'.
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 1s
Failed to build plugin #nativescript/core :
Error: Command gradlew.bat failed with exit code 1
notes
I am running java 11

Cannot Resolve Type Spring Project In Eclipse

So my spring project on eclipse was working fine, I returned to my project a week ago and for some reason there are squiggly red lines every where, saying cannot resolve type all over the whole project. I have tried everything on the internet and dont know the way forward now.
This is what I see when I run gradle
Working Directory: /Users/deso/Documents/workspace-sts-3.9.1.RELEASE/dohinventoryfordoh
Gradle user home: /Users/deso/.gradle
Gradle Distribution: Gradle wrapper from target build
Gradle Version: 4.6
Java Home: /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home
JVM Arguments: None
Program Arguments: None
Build Scans Enabled: false
Offline Mode Enabled: false
Gradle Tasks: build
:compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all files for configuration ':compileClasspath'.
> Could not find org.springframework.boot:spring-boot-starter-aop:.
Required by:
project :
> Could not find org.springframework.boot:spring-boot-starter-data-jpa:.
Required by:
project :
> Could not find org.springframework.boot:spring-boot-starter-web:.
Required by:
project :
> Could not find org.springframework.hateoas:spring-hateoas:.
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
BUILD FAILED in 0s
1 actionable task: 1 executed

Fail to run desktop app with desktop:run LIBGDX

I am using android studio idea for my libgdx project. I configured custom desktop configuration setting
Tasks: desktop:run
Gradle Project: mygame
Running android works fine but running this configuration brings the following error
9:08:42 PM: Executing task 'desktop:run'...
Executing tasks: [desktop:run]
Configuration on demand is an incubating feature. WARNING:
Configuration 'compile' is obsolete and has been replaced with
'implementation'. It will be removed at the end of 2018 Gradle now
uses separate output directories for each JVM language, but this build
assumes a single directory for all classes from a source set. This
behaviour has been deprecated and is scheduled to be removed in Gradle
5.0 at build_4irp102idy0ifcnkhwn53osnp$_run_closure3.doCall(D:\LibgdxProjects\Tembo\desktop\build.gradle:22)
(Run with --stacktrace to get the full stack trace of this
deprecation warning.)
FAILURE: Build failed with an exception.
What went wrong: java.lang.NullPointerException (no error message)
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 9:08:45 PM: Task execution finished 'desktop:run'.
Important details
Gradle version: 4.4
How can i fix this. I tried downgrading my gradle version but the minimim supported is 4.4
NOTE: running gradlew desktop:run on project root works.
currently this version of gradle is not supported you can use version 2.3.3
There is an activity to upgrade to Gradle 4.6 which you can follow up here
https://github.com/libgdx/libgdx/issues/5177

gradle - classnotfoundexception - ToolResolver

I've recently updated the gradle version in a project to 2.13. Since doing so attempts to run any builds, tests, whatnot give me this error:
FAILURE: Build failed with an exception.
* What went wrong:
org/gradle/platform/base/internal/toolchain/ToolResolver
> org.gradle.platform.base.internal.toolchain.ToolResolver
* Try:
Run with --info or --debug option to get more log output.
* Exception is:
java.lang.NoClassDefFoundError: org/gradle/platform/base/internal/toolchain/ToolResolver
The only gradle reference to ToolResolver appears to be in the Java plugin. Is it possible that the plugin is corrupted somehow?
Suggestions on how to fix this?
Try to upgrade Gradle to the latest version

Categories