Using libGDX, and TomGrill's gdx-testing's tests subproject, and trying to run with gradle (gradlew tests:test) the default example from the examples directory and I get this error.
Testing started at 14:47 ...
14:47:05: Executing task 'test'...
Executing tasks: [test]
Configuration on demand is an incubating feature.
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 0s
14:47:06: Task execution finished 'test'.
If I try to run it with IntelliJ's run-tests button
I get the error
Process finished with exit code 1
Class not found: "de.tomgrill.gdxtesting.examples.AssetExistsExampleTest"Empty test suite.
And last, if I try to run only one test from said suite I get the same error.
What am I doing wrong?
Turns out the error was with Gradle versions. I updated to the newest version of Android Gradle Google provides, and used a newer local Gradle as that was needed, and for some reason, this doesn't work. Made a new empty project and left the original Gradle versions, and the tests ran. There might be a better way to fix this, however, I'm going to go with this.
Related
I'm trying to execute the gradlew genSources command here, but it says I'm using an outdated version of java, and that I at least must have Java version 17.
PS D:\Coding Stuff\Java Projekte\Minecraft Mods\fabric-example-mod-1.19> ./gradlew genSources
FAILURE: Build failed with an exception.
* Where:
Build file 'D:\Coding Stuff\Java Projekte\Minecraft Mods\fabric-example-mod-1.19\build.gradle' line: 2
* What went wrong:
An exception occurred applying plugin request [id: 'fabric-loom', version: '1.0-SNAPSHOT']
> Failed to apply plugin 'fabric-loom'.
> You are using an outdated version of Java (8). Java 17 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 621ms
I went to File > Project Structure > Project and the SDK property is clearly set to openjdk-19, the language level property is set to SDK default(19). I went to Settings > Build, Execution, Deployment > Build Tools > Gradle, which tells me that the Gradle JVM property is set to Project SDK openjdk-19.
using a Windows 10 machine
Well, you must use Java 17, because Minecraft 1.19 uses this Java version :)
Since minecraft 1.19 was architectured around jdk-17, some methods end up breaking when running it on jdk-19, meaning the game won't even start.
if you set it to run with jdk-17, it should work fine
I'm trying to do some unity tests in JavaFX application builded in Gradle.
I created a path called test in ../src/.
So in src I have the main package and the test package (src/main and src/test).
When I'm trying to run the test it shows this error message:
Execution failed for task ':test'.
Process 'Gradle Test Executor 1' finished with non-zero exit value 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.
I search in Stack Overflow the same error says that it's in the wrong path and what I see it isn't. Others say that is the pom.xml file without the correct dependence, but I have like 20 pom.xml files in Gradle package. Others say to downgrade the version of JUNIT5.
What should I do?
I am trying to understand gradle.
I followed the gradle tutorial here: https://docs.gradle.org/current/samples/sample_building_java_applications.html#what_youll_build
In short:
I created a folder: mkdir demo
cd demo
gradle init (so far so good)
Now, I tried to run my application like this: gradlew run.
The first run of the application was successful. However, the subsequent runs kept failing and I got a very non descript error.
> Task :app:run FAILED
Error: Could not find or load main class demo.App
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:run'.
> Process 'command 'C:\Program Files\Java\jdk1.8.0_211\bin\java.exe'' finished with non-zero exit value 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.
* Get more help at https://help.gradle.org
BUILD FAILED in 3s
2 actionable tasks: 1 executed, 1 up-to-date
Then, I deleted the files inside "Z:\Projects\demo\ .gradle\6.7.1\executionHistory" and I was able to run the application again.
This was happening again and again. Please see attached screenshot:
What am I doing wrong -- how do I fix this so that all calls to 'gradlew run' give me a successful build?
Edit:
I tried it on C: and was able to do 'gradlew run' consistently and get
the 'Hello World' output without any issues. My Z drive is actually an
encrypted VeraCrypt file which has been loaded with letter 'Z'. Not
sure if that is causing problems.
Thanks!
Hello I was facing the issue too, spend a lot of time and now I am sure, that the issue is the file system. I believe that your encrypted partition is using exFAT. Gradle is not able to process this file system properly.
In one of my projects I get a gradle error message whenever I try to run code in debug mode (^D):
...
> Task :apps:travel-information-service:testClasses UP-TO-DATE
> Task :apps:travel-information-service:test FAILED
FAILURE: Build failed with an exception.
* Where:
Initialization script '/private/var/folders/lx/lnqmbcy557ndwxld1hbsjlf00000gn/T/ijresolvers.gradle' line: 347
* What went wrong:
Execution failed for task ':apps:travel-information-service:test'.
> System property 'idea.debugger.dispatch.port' is not set
* 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 4s
Searching for this issue did not give any results.
It does not matter which code I try to debug (Java applications, junit tests, etc all give the same error). Running the code normally (non-debug mode) works fine. My other projects are fine using the same version of Intellij. I have tried rebooting, invalidating the caches in Intellij, reimporting the gradle project, and even completely removing the .idea directory.
Any tips on how to investigate (or even fix ;-)) this issue are greatly appreciated!
I'm trying my hand at creating a push notification app in ionic. I've been followinthisg tutorial.
When I do a
ionic cordova run android
I receive an error message :
What went wrong:
Execution failed for task ':app:processDebugGoogleServices'.
No matching client found for package name 'io.ionic.starter'
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
Task :app:writeDebugApplicationId UP-TO-DATE
Task :app:processDebugGoogleServices FAILED
Parsing json file: C:\Users\xxx\source\repos\ionic4-push\platforms\android\app\google-services.json
26 actionable tasks: 1 executed, 25 up-to-date
Everything points to the google-services.json file not being there, or being corrupted. The file is indeed at that location, and I've redownloaded the file and replaced it.
I've gone one step further, and attempted to run the command (what I assume) ionic is running, in cmd :
"C:\Program Files\Java\jdk1.8.0_241/bin/java.exe" "-Xmx64m" "-Dorg.gradle.appname=gradlew" -classpath "C:\Users\xxx\source\repos\ionic4-push\platforms\android\gradle\wrapper\gradle-wrapper.jar" org.gradle.wrapper.GradleWrapperMain "cdvBuildDebug" "-b" "C:\Users\xxx\source\repos\ionic4-push\platforms\android\build.gradle"
Can anyone point me in the direction of the cause of this problem?
Have you added app to firebase with io.ionic.starter this package name? and check your google-services.json file, it should contain information related to your package name. This kind of error occurs when your google-services.json file not contain your app information.
Hope it will helps!!