LogCat输出调试帮助 [英] LogCat output debugging help

查看:132
本文介绍了LogCat输出调试帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的程序的Logcat输出失败.它显然无法访问某种SD卡,但是我正在使用仿真器.我使用的是x64 Windows 7,并且以管理员身份运行.

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

推荐答案

在您代码中的FileHandle.java中,您试图将某些内容写入SD卡(第153行).错误权限被拒绝",因此,我假设您没有向AndroidManifest.xml添加正确的权限. 添加:

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" />

应该没问题. 确保已在模拟器中配置了SD卡(使用AVD)

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

这篇关于LogCat输出调试帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆