0
我的Logcat輸出用於我的程序失敗。它顯然無法訪問某種SD卡,但我使用的是仿真器。我在x64的Windows 7上,我以管理員身份運行。LogCat輸出調試幫助
08-29 19:16:29.360: ERROR/AndroidRuntime(707): FATAL EXCEPTION: GLThread 10
08-29 19:16:29.360: ERROR/AndroidRuntime(707): java.lang.ExceptionInInitializerError
08-29 19:16:29.360: ERROR/AndroidRuntime(707): at com.wickeyware.zombiearcher.screen.TitleScreen.render(TitleScreen.java:80)
08-29 19:16:29.360: ERROR/AndroidRuntime(707): at com.wickeyware.zombiearcher.ZombieArcher.render(ZombieArcher.java:49)
08-29 19:16:29.360: ERROR/AndroidRuntime(707): at com.badlogic.gdx.backends.android.AndroidGraphics.onDrawFrame(AndroidGraphics.java:419)
08-29 19:16:29.360: ERROR/AndroidRuntime(707): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1363)
08-29 19:16:29.360: ERROR/AndroidRuntime(707): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1118)
08-29 19:16:29.360: ERROR/AndroidRuntime(707): Caused by: com.badlogic.gdx.utils.GdxRuntimeException: Error writing file: za_data (External)
08-29 19:16:29.360: ERROR/AndroidRuntime(707): at com.badlogic.gdx.files.FileHandle.write(FileHandle.java:157)
08-29 19:16:29.360: ERROR/AndroidRuntime(707): at com.wickeyware.zombiearcher.statistics.Statistics.<clinit>(Statistics.java:70)
08-29 19:16:29.360: ERROR/AndroidRuntime(707): ... 5 more
08-29 19:16:29.360: ERROR/AndroidRuntime(707): Caused by: java.io.FileNotFoundException: /mnt/sdcard/za_data (Permission denied)
08-29 19:16:29.360: ERROR/AndroidRuntime(707): at org.apache.harmony.luni.platform.OSFileSystem.open(Native Method)
08-29 19:16:29.360: ERROR/AndroidRuntime(707): at dalvik.system.BlockGuard$WrappedFileSystem.open(BlockGuard.java:232)
08-29 19:16:29.360: ERROR/AndroidRuntime(707): at java.io.FileOutputStream.<init>(FileOutputStream.java:94)
08-29 19:16:29.360: ERROR/AndroidRuntime(707): at com.badlogic.gdx.files.FileHandle.write(FileHandle.java:153)
08-29 19:16:29.360: ERROR/AndroidRuntime(707): ... 6 more
在您的代碼中,您可能需要訪問sdcard。您可以添加虛擬SD卡到模擬器。 –