Closed GlennFolker closed 3 years ago
Unfortunately, gdx-tools is only compatible with the lwjgl backend ("desktop", not lwjgl3) if used at runtime. People usually pack atlases independently of their project using either a tool like the free Texture Packer GUI or the command-line version of gdx-tools' texture packer. If they pack in code, they have to either have a separate module that depends on gdx-tools and the lwjgl, AKA desktop, backend (which is a good idea, since it means your distributable JARs are a little smaller), or use lwjgl throughout, or use PixmapPacker to pack editable images at runtime. PixmapPacker is part of libGDX, not gdx-tools, so it works with LWJGL 2 and 3, plus Android, iOS, etc.
I'll take a look at your code, since there are ways you can use gdx-tools with LWJGL3 by excluding some of its features. If you've done that, then the error could be caused by something very different.
Well, a full error log sure would have helped...
> Task :tools:packSprites FAILED
Exception in thread "main" java.lang.NoClassDefFoundError: innerclash/Innerclash
at innerclash.tools.SpritePacker.<init>(SpritePacker.java:30)
at innerclash.tools.SpritePacker.main(SpritePacker.java:25)
Caused by: java.lang.ClassNotFoundException: innerclash.Innerclash
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:606)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:168)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 2 more
FAILURE: Build failed with an exception.
* Where:
Build file 'D:\Downloads\Innerclash\Innerclash-master\tools\build.gradle' line: 24
You've done some very strange setup that I do not feel I can fix, since you are depending on your Innerclash class (in the main project) from the tools project's buildscript. The buildscript parts of gradle are... odd, and I have never used them much. I really need to recommend crashinvaders' GDX Texture Packer GUI again; it should make the tools project unneeded. It actually looks like you might just be breaking up an image into a grid of sections, which TextureRegion can do on its own.
That said, this is not a bug in libGDX, it's a bug in your Gradle configuration, so this is not the right place for this. The discord may be more suitable.
Why didn't that happen to me
Forget it, I'm joining the discord
Issue details
AssetManager
says thatsprites.atlas
can't be found when game is run, even though I have packed the sprites to correct directory.Reproduction steps/code
The code is here. To build,
cd
to root directory and run:Then,
cd
to./desktop/build/libs
, and run:Game window opens, then closes due to crash. A crash log should appear in
%APPDATA%\Innerclash\crashes
.Note that this project is made for Java 15.
Version of LibGDX and/or relevant dependencies
libGDX version is
1.9.12
, and I only usegdx-tools
,gdx-backend-lwjgl3
,gdx-platform
, andgdx-controllers-lwjgl3
.Stacktrace
Here's the crash log from a generated file:
Sidenotes
I am very new to both Java programming and using libGDX, I would be really grateful if you could help me. Sorry to waste your time. I'll be back tomorrow.
Please select the affected platforms