libGDX cannot load images?

Anything libgdx related goes here!

libGDX cannot load images?

Postby ericblobb » Fri Jul 11, 2014 2:03 am

I created a new project with the UI and selected only the desktop option (my IDE is IntelliJ). I imported the project, made the configurations for the DesktopLauncher so it could run, and ran it. I got this exception:

Code: Select all
Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load file: badlogic.jpg
   at com.badlogic.gdx.graphics.Pixmap.<init>(Pixmap.java:140)
   at com.badlogic.gdx.graphics.glutils.FileTextureData.prepare(FileTextureData.java:64)
   at com.badlogic.gdx.graphics.Texture.load(Texture.java:130)
   at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:121)
   at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:100)
   at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:92)
   at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:88)
   at com.blobb.something.SomethingGame.create(SomethingGame.java:16)
   at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:136)
   at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:114)
Caused by: com.badlogic.gdx.utils.GdxRuntimeException: File not found: badlogic.jpg (Internal)
   at com.badlogic.gdx.files.FileHandle.read(FileHandle.java:136)
   at com.badlogic.gdx.files.FileHandle.readBytes(FileHandle.java:220)
   at com.badlogic.gdx.graphics.Pixmap.<init>(Pixmap.java:137)
   ... 9 more


What could be going wrong? I did not alter any of the default code at all, and the badlogic.png file is in the assets folder in core.

EDIT: I tried running the project in Spring Suite (since I can't install Gradle on Eclipse), and it ran perfectly fine. So something must be wrong with IntelliJ....
ericblobb
 
Posts: 2
Joined: Fri Jul 11, 2014 1:54 am

Re: libGDX cannot load images?

Postby portfort » Fri Jul 11, 2014 2:13 am

Don't know about IntelliJ, but in Eclipse I have to clean the project every time I add/change an asset file when I want to run it as a desktop app.
portfort
 
Posts: 46
Joined: Fri May 16, 2014 8:20 am

Re: libGDX cannot load images?

Postby ericblobb » Fri Jul 11, 2014 2:27 am

portfort wrote:Don't know about IntelliJ, but in Eclipse I have to clean the project every time I add/change an asset file when I want to run it as a desktop app.


How would I clean a project in IntelliJ?
ericblobb
 
Posts: 2
Joined: Fri Jul 11, 2014 1:54 am

Re: libGDX cannot load images?

Postby portfort » Fri Jul 11, 2014 2:34 am

ericblobb wrote:How would I clean a project in IntelliJ?


Says here (http://www.jetbrains.com/idea/webhelp/c ... cache.html): On the main menu, choose File | Invalidate Caches . The Invalidate Caches message appears informing you that the caches have been invalidated and will be rebuilt on the next startup. To restart IntelliJ IDEA, click Yes.
portfort
 
Posts: 46
Joined: Fri May 16, 2014 8:20 am

Re: libGDX cannot load images?

Postby Bumpy » Fri Jul 11, 2014 5:36 am

portfort wrote:in Eclipse I have to clean the project every time I add/change an asset file when I want to run it as a desktop app.


FYI: In Eclipse, I only had to refresh the Android/Assets folder (i.e. not clean) until I discovered...

Window > Preferences > General > Workspace > "Refresh automatically"

Now I don't have to do anything.
Why not give my game a whirl... Sky Scraper - Match & Build
Bumpy
 
Posts: 66
Joined: Sat Apr 19, 2014 4:14 am


Return to Libgdx

Who is online

Users browsing this forum: Google Feedfetcher and 1 guest