FallingSandJava
FallingSandJava copied to clipboard
Project fails to run.
Hy, I followed your video on youtube to this repo. I really wat to learn this stuff, so I tried to make my hands dirty. However, Im not a Java developer, and do not know a single thing about Gradle and all the odher stuff. However, Pulled the projekt from your repo, but it failed to build. There were two major problem:
- Gradle is looking for and outdated version, as such gradle fails to build: GradleBuildLog.txt
- When the main window is tarted (dektop build) it flashes and moves away, and complains that it can not find the UI asset (uiskin.atlas). BuildLog.txt
System specs:
- Windows 10
- VSCode 1.87.2
- ExtensionPack for Java 0.25.15
- Java 21.0.2
- Gradle for Java 3.15.5
- Language Support for Java(TM) by Red Hat 1.28.1
I would be very thankful if you could fix these, or at least give me a guide on how to make it build and run, at least on the desktop!
Thank you!
Update: I have created a Fork with the changes.
Successful Gradle Build Changes
This document outlines the modifications made to the desktop/build.gradle
file that resulted in a successful Gradle build.
Git Diff:
diff --git a/desktop/build.gradle b/desktop/build.gradle index 55d193b..d2b43ec 100644 --- a/desktop/build.gradle +++ b/desktop/build.gradle @@ -1,10 +1,26 @@ -apply plugin: "java" +plugins {
- id 'java' +}
sourceCompatibility = 1.8 sourceSets.main.java.srcDirs = [ "src/" ]
project.ext.mainClassName = "com.gdx.cellular.desktop.DesktopLauncher" -project.ext.assetsDir = new File("../core/assets"); +project.ext.assetsDir = new File("../core/assets") + +configurations {
- compileOnly {
-
extendsFrom annotationProcessor
- } +}
Explanation of Changes:
-
Plugin Application:
- Removed the single line
apply plugin: "java"
. - Added a new
plugins
block withid 'java'
inside it. This is the new way to apply plugins in Gradle.
- Removed the single line
-
Assets Directory:
- No change to the line
project.ext.assetsDir = new File("../core/assets")
.
- No change to the line
-
Compile-Only Configuration:
- Added a new
configurations
block. - Inside the block, a new configuration named
compileOnly
is defined. -
extendsFrom annotationProcessor
indicates that this configuration inherits dependencies from theannotationProcessor
configuration, which is typically used for annotation processors.
- Added a new
These changes ensure proper plugin application and potentially improve dependency management for annotation processors in your Gradle build.
The Issue with the unreachable ssset (1. in original Issue) still persists.
I haven't run this project in a long time so I am not sure exactly what the issue might be. Since it did run successfully in its current state in the repo my best guess is that your version of gradle is too new and it would work if you downgraded your version of gradle. Since the build is complaining about older features with the older version of gradle I used at the time.
Thank you for responding, I have rolled back gradle for VSCode to v3.6.1 (as early as possible) and it removed or at least concealed the gradle related error. However I have an Issue where an asset can not be reached or referenced:
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Try the new cross-platform PowerShell https://aka.ms/pscore6
PS D:\CSharpCourse\Raylib\RayLibWorkspaces\FallingSandJava> & 'C:\Program Files\Zulu\zulu-8-jre\bin\java.exe' '-agentlib:jdwp=transport=dt_socket,server=n,suspend=y,address=localhost:60736' '-cp' 'C:\Users\z004c8cj\AppData\Local\Temp\cp_71o5qd2p3uh7b8ilqiun1zuj5.jar' 'com.gdx.cellular.desktop.DesktopLauncher'
Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: com.badlogic.gdx.utils.GdxRuntimeException: File not found: uiskin.atlas (Internal)
at com.badlogic.gdx.assets.AssetManager.handleTaskError(AssetManager.java:621)
at com.badlogic.gdx.assets.AssetManager.update(AssetManager.java:411)
at com.badlogic.gdx.assets.AssetManager.finishLoading(AssetManager.java:437)
at com.gdx.cellular.ui.Skins.getSkin(Skins.java:26)
at com.gdx.cellular.ui.CreatorMenu.createDropdownStage(CreatorMenu.java:45)
at com.gdx.cellular.ui.CreatorMenu.<init>(CreatorMenu.java:40)
at com.gdx.cellular.input.InputManager.<init>(InputManager.java:81)
at com.gdx.cellular.CellularAutomaton.create(CellularAutomaton.java:69)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:149)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:126)
Caused by: com.badlogic.gdx.utils.GdxRuntimeException: File not found: uiskin.atlas (Internal)
at com.badlogic.gdx.files.FileHandle.read(FileHandle.java:142)
at com.badlogic.gdx.graphics.g2d.TextureAtlas$TextureAtlasData.<init>(TextureAtlas.java:103)
at com.badlogic.gdx.assets.loaders.TextureAtlasLoader.getDependencies(TextureAtlasLoader.java:60)
at com.badlogic.gdx.assets.loaders.TextureAtlasLoader.getDependencies(TextureAtlasLoader.java:34)
at com.badlogic.gdx.assets.AssetLoadingTask.handleSyncLoader(AssetLoadingTask.java:99)
at com.badlogic.gdx.assets.AssetLoadingTask.update(AssetLoadingTask.java:88)
at com.badlogic.gdx.assets.AssetManager.updateTask(AssetManager.java:546)
at com.badlogic.gdx.assets.AssetManager.update(AssetManager.java:409)
... 8 more
PS D:\CSharpCourse\Raylib\RayLibWorkspaces\FallingSandJava>
If you could respond to this I would be very greatful.
Thank you in advance!