Libgdx project Exception in thread "LWJGL Application". Failed to upload file. Error registering inside

I am new to libgdx and just got it in android studio. Now I get this error when I press the start button for the first time.

 /Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home/bin/java Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load file: badlogic1.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.TigerBudda.ZombieBird.ZBGame.create(ZBGame.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: badlogic1.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 
+8
android-studio libgdx
source share
3 answers

Are you starting the desktop application? Make sure you bind your desktop resources to the Android resources folder?

In Eclipse: New libgdx installation get file not found

Edited by:

In Android Studio

Select Change Configuration .. => "Working Directory" => Change the folder to android/assets

Edit Configuration ..Edit Configuration2

+46
source share
 static{ System.out.println(Gdx.files.getLocalStoragePath()); } 

He displayed the path to the project root folder outside of special modules for Android and desktop computers. Copied to files along the path relative to the project root folder and worked.

Project Project / kernel Project / Android Project / desktop Project / html Project / Android / assets / data / img.png What worked: Project / data / img.png

+2
source share

In my case, installing the nvidia-375 driver solved the problem.

 sudo add-apt-repository ppa:graphics-drivers/ppa sudo apt-get update sudo apt-get install nvidia-375 

reboot. And then tada! It works.

0
source share

All Articles