I'm working on a game, and for some I'm getting this error when I try to run it on my tablet or on my simulator. I've never gotten this error before, and I understand generally in what means it is to fix it. I just can't find where to fix it.
我正在开发一款游戏,有些人在尝试在平板电脑或模拟器上运行时遇到此错误。我以前从来没有弄过这个错误,而且我一般都理解它是什么意思来修复它。我找不到在哪里修理它。
05-12 21:58:43.012: E/AndroidRuntime(1067): FATAL EXCEPTION: GLThread 81
05-12 21:58:43.012: E/AndroidRuntime(1067): Process: com.Zhalex.KatsAndYoonicorns, PID: 1067
05-12 21:58:43.012: E/AndroidRuntime(1067): com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load file: smallFont.png
05-12 21:58:43.012: E/AndroidRuntime(1067): at com.badlogic.gdx.graphics.Pixmap.<init>(Pixmap.java:140)
05-12 21:58:43.012: E/AndroidRuntime(1067): at com.badlogic.gdx.graphics.glutils.FileTextureData.prepare(FileTextureData.java:64)
05-12 21:58:43.012: E/AndroidRuntime(1067): at com.badlogic.gdx.graphics.Texture.load(Texture.java:175)
05-12 21:58:43.012: E/AndroidRuntime(1067): at com.badlogic.gdx.graphics.Texture.create(Texture.java:159)
05-12 21:58:43.012: E/AndroidRuntime(1067): at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:133)
05-12 21:58:43.012: E/AndroidRuntime(1067): at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:126)
05-12 21:58:43.012: E/AndroidRuntime(1067): at com.badlogic.gdx.graphics.g2d.BitmapFont.<init>(BitmapFont.java:114)
05-12 21:58:43.012: E/AndroidRuntime(1067): at com.badlogic.gdx.graphics.g2d.BitmapFont.<init>(BitmapFont.java:106)
05-12 21:58:43.012: E/AndroidRuntime(1067): at com.Zhalex.assets.Assets.loadFonts(Assets.java:222)
05-12 21:58:43.012: E/AndroidRuntime(1067): at com.Zhalex.assets.Assets.loadAll(Assets.java:133)
05-12 21:58:43.012: E/AndroidRuntime(1067): at com.Zhalex.KatsAndYoonicorns.KatsAndYoonicorns.create(KatsAndYoonicorns.java:42)
05-12 21:58:43.012: E/AndroidRuntime(1067): at com.badlogic.gdx.backends.android.AndroidGraphics.onSurfaceChanged(AndroidGraphics.java:322)
05-12 21:58:43.012: E/AndroidRuntime(1067): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1512)
05-12 21:58:43.012: E/AndroidRuntime(1067): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)
05-12 21:58:43.012: E/AndroidRuntime(1067): Caused by: com.badlogic.gdx.utils.GdxRuntimeException: Error reading file: smallFont.png (Internal)
05-12 21:58:43.012: E/AndroidRuntime(1067): at com.badlogic.gdx.backends.android.AndroidFileHandle.read(AndroidFileHandle.java:74)
05-12 21:58:43.012: E/AndroidRuntime(1067): at com.badlogic.gdx.files.FileHandle.length(FileHandle.java:585)
05-12 21:58:43.012: E/AndroidRuntime(1067): at com.badlogic.gdx.backends.android.AndroidFileHandle.length(AndroidFileHandle.java:162)
05-12 21:58:43.012: E/AndroidRuntime(1067): at com.badlogic.gdx.files.FileHandle.readBytes(FileHandle.java:220)
05-12 21:58:43.012: E/AndroidRuntime(1067): at com.badlogic.gdx.graphics.Pixmap.<init>(Pixmap.java:137)
05-12 21:58:43.012: E/AndroidRuntime(1067): ... 13 more
05-12 21:58:43.012: E/AndroidRuntime(1067): Caused by: java.io.FileNotFoundException: smallFont.png
05-12 21:58:43.012: E/AndroidRuntime(1067): at android.content.res.AssetManager.openAsset(Native Method)
05-12 21:58:43.012: E/AndroidRuntime(1067): at android.content.res.AssetManager.open(AssetManager.java:316)
05-12 21:58:43.012: E/AndroidRuntime(1067): at android.content.res.AssetManager.open(AssetManager.java:290)
05-12 21:58:43.012: E/AndroidRuntime(1067): at com.badlogic.gdx.backends.android.AndroidFileHandle.read(AndroidFileHandle.java:72)
05-12 21:58:43.012: E/AndroidRuntime(1067): ... 17 more
1 个解决方案
#1
It looks like you need to put the smallFont.png file to the asset directory in the project.
看起来您需要将smallFont.png文件放到项目的资产目录中。
The error is generated for missing the asset file.
生成错误以丢失资产文件。
#1
It looks like you need to put the smallFont.png file to the asset directory in the project.
看起来您需要将smallFont.png文件放到项目的资产目录中。
The error is generated for missing the asset file.
生成错误以丢失资产文件。