LogCat output debugging help

二次信任 提交于 2019-12-13 03:07:03

问题


My Logcat output for my program failing. It apparently can't access some kind of SD card, but I'm using the emulator. I'm on x64 windows 7, and I ran as administrator.

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

回答1:


In FileHandle.java in your code you're trying to write something to the SD card (line 153). The error "Permission Denied", therefore I assume you didn't add the correct permission to your AndroidManifest.xml. Add:

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

And it should be ok. Make sure you have an SD card configured in the emulator (using the AVD)



来源:https://stackoverflow.com/questions/7234777/logcat-output-debugging-help

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!