user3397452
user3397452

Reputation: 7051

Adding images to LibGDX project assets

I quickly created an image in Microsoft Paint and saved it as ace.png.
I also refreshed the project using F5. I cleaned the project as well through Project -> Clean...

When I tried to run the project, an error occurs:

Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load file: data/ace.png

Here is an image showing that I have ace.png saved in the correct place and it also shows that in my Package Explorer, it doesn't show the image.

How do I update the assets/data folder?

Upvotes: 0

Views: 1282

Answers (1)

pt2121
pt2121

Reputation: 11870

From your project snapshot, it seems ace.png is not in the data folder. You have to copy the image to assets/data/ in Android project. (You can just drag and drop the file from Windows Explorer to Eclipse.) Also try refreshing the project if you're sure the file is there. (Click on the project in Project Explorer and hit F5.)

Please let me know if this helps.

enter image description here

Upvotes: 2

Related Questions