LibGDX "GwtApplication: exception: Couldn't load image 'a.jpg'

1.1k views Asked by At

Error message: "GwtApplication: exception: Couldn't load image 'a.jpg', file does not exist"

The call is:

Texture texture;
texture =new Texture(Gdx.files.internal("a.jpg"));

The application runs normally when ran as desktop application. The file exists in the core/assets folder and the war/assets folder. I am using IntelliJ IDE. Any help would be much appreciated!

update: When I compile and run as a normal desktop application (gradlew desktop:run) it runs as expected. But when I run as HTML5 (gradlew.bat html:superDev) it can't find the image and Gwt throws the exception. This seems to be a Gwt run-time error.

actual output: enter image description here

1

There are 1 answers

0
IHaveAComputer On