Libgdx应用程序无法在Android模拟器上运行

时间:2014-03-21 19:11:37

标签: android libgdx avd

我一直试图解决这个问题几天。我试图在eclipse上运行Android模拟器上的应用程序,当我点击我的应用程序时,它给了我一个错误"不幸的是,应用程序已停止"以下是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

1 个答案:

答案 0 :(得分:2)

不要让这个问题没有答案......

它在您的桌面版本上运行,因为您的桌面版本是Micosoft Windows,他们不关心文件名中的大小写。 data/Texture.png与Windows的data/tEXtUre.png相同,因此无任何问题。

我所知道的其他所有操作系统都关注文件名中的情况,因此在Android上,当data/texture.png实际命名为data/Texture.png时,您无法找到该文件。

我建议您只在文件时使用小写字母。