致命异常:GLThread 84:FileNotFoundException异常的Andr​​oid logcat的错误 [英] FATAL EXCEPTION: GLThread 84: FileNotFoundException Android logcat errors

查看:161
本文介绍了致命异常:GLThread 84:FileNotFoundException异常的Andr​​oid logcat的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的游戏运行正常,当我测试的桌面版本,但是当我推出一个Android模拟器,并并尝试在模拟器游戏关闭运行的游戏,我得到了logcat的错误:

  8月10号至28号:00:53.528:E / AndroidRuntime(1203):致命异常:GLThread 84
八月10日至28日:00:53.528:E / AndroidRuntime(1203):工艺:com.mkgame.game1.android,PID:1203
八月10日至28日:00:53.528:E / AndroidRuntime(1203):com.badlogic.gdx.utils.GdxRuntimeException:无法加载文件:playButton2.png
八月10日至28日:00:53.528:E / AndroidRuntime(1203):在com.badlogic.gdx.graphics.Pixmap< INIT>(Pixmap.java:140)
八月10日至28日:00:53.528:E / AndroidRuntime(1203):在com.badlogic.gdx.graphics.glutils.FileTextureData prepare(FileTextureData.java:64)
八月10日至28日:00:53.528:E / AndroidRuntime(1203):在com.badlogic.gdx.graphics.Texture.load(Texture.java:130)
八月10日至28日:00:53.528:E / AndroidRuntime(1203):在com.badlogic.gdx.graphics.Texture< INIT>(Texture.java:121)
八月10日至28日:00:53.528:E / AndroidRuntime(1203):在com.badlogic.gdx.graphics.Texture< INIT>(Texture.java:100)
八月10日至28日:00:53.528:E / AndroidRuntime(1203):在com.badlogic.gdx.graphics.Texture< INIT>(Texture.java:92)
八月10日至28日:00:53.528:E / AndroidRuntime(1203):在com.MKgames.game1.screen.MainMenuScreen< INIT>(MainMenuScreen.java:38)
八月10日至28日:00:53.528:E / AndroidRuntime(1203):在com.MKgames.Game1.create(Game1.java:29)
八月10日至28日:00:53.528:E / AndroidRuntime(1203):在com.badlogic.gdx.backends.android.AndroidGraphics.onSurfaceChanged(AndroidGraphics.java:236)
八月10日至28日:00:53.528:E / AndroidRuntime(1203):在android.opengl.GLSurfaceView $ GLThread.guardedRun(GLSurfaceView.java:1512)
八月10日至28日:00:53.528:E / AndroidRuntime(1203):在android.opengl.GLSurfaceView $ GLThread.run(GLSurfaceView.java:1240)
八月10日至28日:00:53.528:E / AndroidRuntime(1203):com.badlogic.gdx.utils.GdxRuntimeException:产生的原因读取文件时出错:playButton2.png(内部)
八月10日至28日:00:53.528:E / AndroidRuntime(1203):在com.badlogic.gdx.backends.android.AndroidFileHandle.read(AndroidFileHandle.java:77)
八月10日至28日:00:53.528:E / AndroidRuntime(1203):在com.badlogic.gdx.files.FileHandle.readBytes(FileHandle.java:220)
八月10日至28日:00:53.528:E / AndroidRuntime(1203):在com.badlogic.gdx.graphics.Pixmap< INIT>(Pixmap.java:137)
八月10日至28日:00:53.528:E / AndroidRuntime(1203):10 ...更多
八月10日至28日:00:53.528:E / AndroidRuntime(1203):java.io.FileNotFoundException:产生的原因playButton2.png
八月10日至28日:00:53.528:E / AndroidRuntime(1203):在android.content.res.AssetManager.openAsset(本机方法)
八月10日至28日:00:53.528:E / AndroidRuntime(1203):在android.content.res.AssetManager.open(AssetManager.java:316)
八月10日至28日:00:53.528:E / AndroidRuntime(1203):在android.content.res.AssetManager.open(AssetManager.java:290)
八月10日至28日:00:53.528:E / AndroidRuntime(1203):在com.badlogic.gdx.backends.android.AndroidFileHandle.read(AndroidFileHandle.java:75)
八月10日至28日:00:53.528:E / AndroidRuntime(1203):12 ...更多
 

我的理解是错误migh是显而易见的,没有找到该文件,但它应该是因为它的位置就可以了,当我运行它作为一个桌面应用程序的文件是好的(我复制了所有我的桌面资产注入机器人资产,它们有完全一样的)。 但是,是什么问题呢?

下面是我设置图像:

 纹理playButtonTxture =新的纹理(Gdx.files.internal(playButton2.png));
 

解决方案

您使用。

 纹理=新的纹理(Gdx.files.internal(YourPath / YourFile.png));
 

另一方面,仿真器使用虚拟磁盘要知道,他们让事情:)没当回事也许是错误来自那里。

编辑:在你的包浏览器

asssets - > yourfile.png

资产 - > yourFolder - > yourfile.png

新功能: 你的错误是,在你Android作为nombre.png草案是Windows快捷方式将照片和删除照片的副本,如果你这样做,一定要preSS拖动我觉得Windows的控制也复制

My game runs correctly when I test the desktop version, but when I launch an android emulator and and try to run the game on the emulator the game closes and I get the logcat errors:

10-28 08:00:53.528: E/AndroidRuntime(1203): FATAL EXCEPTION: GLThread 84
10-28 08:00:53.528: E/AndroidRuntime(1203): Process: com.mkgame.game1.android, PID: 1203
10-28 08:00:53.528: E/AndroidRuntime(1203): com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load file: playButton2.png
10-28 08:00:53.528: E/AndroidRuntime(1203):     at com.badlogic.gdx.graphics.Pixmap.<init>(Pixmap.java:140)
10-28 08:00:53.528: E/AndroidRuntime(1203):     at com.badlogic.gdx.graphics.glutils.FileTextureData.prepare(FileTextureData.java:64)
10-28 08:00:53.528: E/AndroidRuntime(1203):     at com.badlogic.gdx.graphics.Texture.load(Texture.java:130)
10-28 08:00:53.528: E/AndroidRuntime(1203):     at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:121)
10-28 08:00:53.528: E/AndroidRuntime(1203):     at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:100)
10-28 08:00:53.528: E/AndroidRuntime(1203):     at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:92)
10-28 08:00:53.528: E/AndroidRuntime(1203):     at com.MKgames.game1.screen.MainMenuScreen.<init>(MainMenuScreen.java:38)
10-28 08:00:53.528: E/AndroidRuntime(1203):     at com.MKgames.Game1.create(Game1.java:29)
10-28 08:00:53.528: E/AndroidRuntime(1203):     at com.badlogic.gdx.backends.android.AndroidGraphics.onSurfaceChanged(AndroidGraphics.java:236)
10-28 08:00:53.528: E/AndroidRuntime(1203):     at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1512)
10-28 08:00:53.528: E/AndroidRuntime(1203):     at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)
10-28 08:00:53.528: E/AndroidRuntime(1203): Caused by: com.badlogic.gdx.utils.GdxRuntimeException: Error reading file: playButton2.png (Internal)
10-28 08:00:53.528: E/AndroidRuntime(1203):     at com.badlogic.gdx.backends.android.AndroidFileHandle.read(AndroidFileHandle.java:77)
10-28 08:00:53.528: E/AndroidRuntime(1203):     at com.badlogic.gdx.files.FileHandle.readBytes(FileHandle.java:220)
10-28 08:00:53.528: E/AndroidRuntime(1203):     at com.badlogic.gdx.graphics.Pixmap.<init>(Pixmap.java:137)
10-28 08:00:53.528: E/AndroidRuntime(1203):     ... 10 more
10-28 08:00:53.528: E/AndroidRuntime(1203): Caused by: java.io.FileNotFoundException: playButton2.png
10-28 08:00:53.528: E/AndroidRuntime(1203):     at android.content.res.AssetManager.openAsset(Native Method)
10-28 08:00:53.528: E/AndroidRuntime(1203):     at android.content.res.AssetManager.open(AssetManager.java:316)
10-28 08:00:53.528: E/AndroidRuntime(1203):     at android.content.res.AssetManager.open(AssetManager.java:290)
10-28 08:00:53.528: E/AndroidRuntime(1203):     at com.badlogic.gdx.backends.android.AndroidFileHandle.read(AndroidFileHandle.java:75)
10-28 08:00:53.528: E/AndroidRuntime(1203):     ... 12 more

I understand that the error migh be obvious that the file is not found, but it should be as it's location is fine and when i run it as a desktop app the file is fine (I copied all of my desktop assets into the android assets, they there are exactly the same). So what could the problem be?

Here is where i set the image:

Texture playButtonTxture = new Texture(Gdx.files.internal("playButton2.png"));

解决方案

your use.

texture = new Texture (Gdx.files.internal("YourPath/YourFile.png"));

other hand, emulators use virtual disk "to know where they keep things :)" no seriously maybe the error comes from there.

Edit: in your package explorer

asssets-->yourfile.png

or

assets-->yourFolder-->yourfile.png

NEW: Your mistake is that in the draft you have android as nombre.png is a windows shortcut to the photo and delete them photo copy, if you do be sure to press the dragging I think windows control was also to copy

这篇关于致命异常:GLThread 84:FileNotFoundException异常的Andr​​oid logcat的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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