0

I've been trying to figure this out for couple days. I've tried to run the app on android emulator on eclipse and when I clicked on my app it gives me an error "unfortunately, app has stopped" The following is the Logcat.

03-21 19:01:19.145: I/AndroidGraphics(863): Managed buffers/app: { }
03-21 19:01:19.585: W/dalvikvm(863): threadid=11: thread exiting with uncaught exception (group=0x40a71930)
03-21 19:01:19.715: E/AndroidRuntime(863): FATAL EXCEPTION: GLThread 87
03-21 19:01:19.715: E/AndroidRuntime(863): com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load file: data/texture.png
03-21 19:01:19.715: E/AndroidRuntime(863):  at com.badlogic.gdx.graphics.Pixmap.<init>(Pixmap.java:140)
03-21 19:01:19.715: E/AndroidRuntime(863):  at com.badlogic.gdx.graphics.glutils.FileTextureData.prepare(FileTextureData.java:64)
03-21 19:01:19.715: E/AndroidRuntime(863):  at com.badlogic.gdx.graphics.Texture.load(Texture.java:142)
03-21 19:01:19.715: E/AndroidRuntime(863):  at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:133)
03-21 19:01:19.715: E/AndroidRuntime(863):  at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:112)
03-21 19:01:19.715: E/AndroidRuntime(863):  at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:104)
03-21 19:01:19.715: E/AndroidRuntime(863):  at com.AukaD.myHelpers.AssetLoader.load(AssetLoader.java:33)
03-21 19:01:19.715: E/AndroidRuntime(863):  at com.AukaD.FlyBird.MyGame.create(MyGame.java:10)
03-21 19:01:19.715: E/AndroidRuntime(863):  at com.badlogic.gdx.backends.android.AndroidGraphics.onSurfaceChanged(AndroidGraphics.java:334)
03-21 19:01:19.715: E/AndroidRuntime(863):  at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1505)
03-21 19:01:19.715: E/AndroidRuntime(863):  at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)
03-21 19:01:19.715: E/AndroidRuntime(863): Caused by: com.badlogic.gdx.utils.GdxRuntimeException: Error reading file: data/texture.png (Internal)
03-21 19:01:19.715: E/AndroidRuntime(863):  at com.badlogic.gdx.backends.android.AndroidFileHandle.read(AndroidFileHandle.java:74)
03-21 19:01:19.715: E/AndroidRuntime(863):  at com.badlogic.gdx.files.FileHandle.length(FileHandle.java:563)
03-21 19:01:19.715: E/AndroidRuntime(863):  at com.badlogic.gdx.backends.android.AndroidFileHandle.length(AndroidFileHandle.java:162)
03-21 19:01:19.715: E/AndroidRuntime(863):  at com.badlogic.gdx.files.FileHandle.readBytes(FileHandle.java:218)
03-21 19:01:19.715: E/AndroidRuntime(863):  at com.badlogic.gdx.graphics.Pixmap.<init>(Pixmap.java:137)
03-21 19:01:19.715: E/AndroidRuntime(863):  ... 10 more
03-21 19:01:19.715: E/AndroidRuntime(863): Caused by: java.io.FileNotFoundException: data/texture.png
03-21 19:01:19.715: E/AndroidRuntime(863):  at android.content.res.AssetManager.openAsset(Native Method)
03-21 19:01:19.715: E/AndroidRuntime(863):  at android.content.res.AssetManager.open(AssetManager.java:315)
03-21 19:01:19.715: E/AndroidRuntime(863):  at android.content.res.AssetManager.open(AssetManager.java:289)
03-21 19:01:19.715: E/AndroidRuntime(863):  at com.badlogic.gdx.backends.android.AndroidFileHandle.read(AndroidFileHandle.java:72)
03-21 19:01:19.715: E/AndroidRuntime(863):  ... 14 more
  • We would need code, but the error says it can't load data/texture.png. You should probably make sure that everything is correct with loading it. You should also probably make sure the size is something that can be handled. – user695992 Mar 21 '14 at 19:14
  • What happens if you run the desktop version? – donfuxx Mar 21 '14 at 19:20
  • Does this Caused by: java.io.FileNotFoundException: data/texture.png tell you anything? – Phantômaxx Mar 21 '14 at 19:23
  • @donfuxx It works fine on desktop version, runs smoothly. – user3443345 Mar 21 '14 at 19:28
  • 1
    Hey Thx! everyone for helping, I figured it out. I saved the texture.png in assets folder as capital "Texture.png, but tried to load it as "texture.png". Saved my life. – user3443345 Mar 21 '14 at 19:52
2

To not leave this question unanswered...

It runs on your desktop version, because your desktop version is Micosoft Windows and they do not care about the case in file names. data/Texture.png is the same as data/tEXtUre.png for Windows and thus it works without any problems.

Every other OS that I know of, cares about the case in filenames and thus on Android you don't find the file when loading it as data/texture.png when it is actually named data/Texture.png.

I'd advise you to always use lower case only when it's about files.

|improve this answer|||||
  • Are you sure that windows is case insensitive? I am using Eclipse on windows 7 and as much as i remember (i am not sure...) i got some couldn't load file errors cause of the case. As i said those errors could also have been for something different (wrong name). So well i am just curious about that :P – Springrbua Apr 1 '14 at 12:19
  • @Springrbua I'm pretty sure. It also explains the behaviour which is described in the question here. It may depend on the Windows version though. – noone Apr 1 '14 at 12:27
  • Ah okay thanks a lot, maybe it was another error in my case, i can't remember. Good to know – Springrbua Apr 1 '14 at 12:37
  • @noone was right! It solved my problem after switching capital "Texture" to small t. – user3443345 Apr 9 '14 at 18:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.