简体   繁体   English

Android Studio加载纹理错误

[英]Android Studio Loading Texture error

I have this strange error where I can't load any textures anymore. 我遇到了一个奇怪的错误,我无法再加载任何纹理。 The assets that I used are fine, but when I try to add new assets, it throws me this: 我使用的资产很好,但是当我尝试添加新资产时,会抛出以下信息:

E/AndroidRuntime: FATAL EXCEPTION: GLThread 9855
Process: com.NeverMind.MainClass.android, PID: 18482
com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load file: bg.png
     at com.badlogic.gdx.graphics.Pixmap.<init>(Pixmap.java:140)
     at com.badlogic.gdx.graphics.TextureData$Factory.loadFromFile(TextureData.java:98)
     at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:100)
     at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:92)
     at com.NeverMind.DontFall.android.MainClass.create(MainClass.java:200)
     at com.badlogic.gdx.backends.android.AndroidGraphics.onSurfaceChanged(AndroidGraphics.java:241)
     at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1520)
     at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1248)
Caused by: java.io.IOException: Error loading pixmap: decoder init failed for stream
     at com.badlogic.gdx.graphics.g2d.Gdx2DPixmap.<init>(Gdx2DPixmap.java:57)
     at com.badlogic.gdx.graphics.Pixmap.<init>(Pixmap.java:138)
     at com.badlogic.gdx.graphics.TextureData$Factory.loadFromFile(TextureData.java:98) 
     at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:100) 
     at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:92) 
     at com.NeverMind.DontFall.android.MainClass.create(MainClass.java:200) 
     at com.badlogic.gdx.backends.android.AndroidGraphics.onSurfaceChanged(AndroidGraphics.java:241) 
     at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1520) 
     at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1248) 

I didn't do anything stupid. I also tried to trick him and put the new texture with the name of an old one and it didn't work. This is the first time this happens, I have thousands of lines in the code. 

The problem was with the bit depth. 问题出在位深度上。 It needs to be smaller. 它需要更小。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM