0

I'm trying to render a model in libgdx - everything runs perfectly on the desktop, but on android force stop on modelBatch.render(poleInstance, environment);

Log:

03-30 16:37:40.317    5249-5249/? E/cutils-trace﹕ Error opening trace file: No such file or directory (2)
03-30 16:37:42.621    5269-5269/? E/cutils-trace﹕ Error opening trace file: No such file or directory (2)
03-30 16:37:46.181    5283-5283/com.badlogic.gdx.tests E/OpenGLRenderer﹕ Getting MAX_TEXTURE_SIZE from GradienCache
03-30 16:37:46.209    5283-5283/com.badlogic.gdx.tests E/OpenGLRenderer﹕ Getting MAX_TEXTURE_SIZE from Caches::initConstraints()
03-30 16:37:46.533    5283-5297/com.badlogic.gdx.tests E/EGL_genymotion﹕ [getAttribValue] Bad attribute idx
03-30 16:37:46.533    5283-5297/com.badlogic.gdx.tests E/EGL_genymotion﹕ tid 5297: eglGetConfigAttrib(605): error 0x3004 (EGL_BAD_ATTRIBUTE)
03-30 16:37:46.533    5283-5297/com.badlogic.gdx.tests E/EGL_genymotion﹕ [getAttribValue] Bad attribute idx
03-30 16:37:46.533    5283-5297/com.badlogic.gdx.tests E/EGL_genymotion﹕ tid 5297: eglGetConfigAttrib(605): error 0x3004 (EGL_BAD_ATTRIBUTE)
03-30 16:37:46.825    5283-5297/com.badlogic.gdx.tests E/AndroidRuntime﹕ FATAL EXCEPTION: GLThread 168
    com.badlogic.gdx.utils.GdxRuntimeException: File not found: com/badlogic/gdx/graphics/g3d/shaders/default.vertex.glsl (Classpath)
            at com.badlogic.gdx.files.FileHandle.read(FileHandle.java:134)
            at com.badlogic.gdx.backends.android.AndroidFileHandle.read(AndroidFileHandle.java:78)
            at com.badlogic.gdx.files.FileHandle.length(FileHandle.java:548)
            at com.badlogic.gdx.backends.android.AndroidFileHandle.length(AndroidFileHandle.java:167)
            at com.badlogic.gdx.files.FileHandle.estimateLength(FileHandle.java:229)
            at com.badlogic.gdx.files.FileHandle.readString(FileHandle.java:194)
            at com.badlogic.gdx.files.FileHandle.readString(FileHandle.java:187)
            at com.badlogic.gdx.graphics.g3d.shaders.DefaultShader.getDefaultVertexShader(DefaultShader.java:409)
            at com.badlogic.gdx.graphics.g3d.shaders.DefaultShader.<init>(DefaultShader.java:504)
            at com.badlogic.gdx.graphics.g3d.shaders.DefaultShader.<init>(DefaultShader.java:500)
            at com.badlogic.gdx.graphics.g3d.utils.DefaultShaderProvider.createShader(DefaultShaderProvider.java:46)
            at com.badlogic.gdx.graphics.g3d.utils.BaseShaderProvider.getShader(BaseShaderProvider.java:34)
            at com.badlogic.gdx.graphics.g3d.ModelBatch.render(ModelBatch.java:269)
            at com.badlogic.gdx.tests.PathTest.render(PathTest.java:221)
            at com.badlogic.gdx.backends.android.AndroidGraphics.onDrawFrame(AndroidGraphics.java:391)
            at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1523)
            at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)
03-30 16:37:51.401    5283-5283/com.badlogic.gdx.tests E/AndroidGraphics﹕ waiting for pause synchronization took too long; assuming deadlock and killing
03-30 16:37:51.521      475-517/system_process E/InputDispatcher﹕ channel '528ce2b4 com.badlogic.gdx.tests/com.badlogic.gdx.tests.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!

Yes, my question is similar to this, but updating the library didn't helped And yes, file com/badlogic/gdx/graphics/g3d/shaders/default.vertex.glsl in place

My code place here

Community
  • 1
  • 1
lucidyan
  • 3,575
  • 2
  • 22
  • 24

2 Answers2

1

The error is File not found, so apparently it cannot find the file. If you are sure the file is included, this might be caused by duplicate references (although it doesn't have to). For example if you include (and export) the gdx library in both your core and android project. You could check this by right clicking each project, click on Java Build Path and then the Order and Export tab. Make sure that the gdx project (or jar, depending if you work from source or nightly/stable) is only included (and exported by clicking the checkbox) in the core project.

However, having assets (which the shader files are) on the classpath is merely to support out-of-box rendering for libgdx. In your case would advise to copy the shader files to (a subfolder of) your assets folder and use those instead. That makes managing your assets a lot cleaner. You can load the shaders using the constructor of ModelBatch, e.g.:

modelbatch = new ModelBatch(Gdx.files.internal("data/default.vertex.glsl"), Gdx.files.internal("data/default.fragment.glsl"));

Of course, you still might want to double check your project configuration.

Xoppa
  • 7,983
  • 1
  • 23
  • 34
0

Please install Arm Transition on your Genymotion Emulator

Here is a detailed guide on How to install this transition :

How to install Google Play Services in a Genymotion VM (with no drag and drop support)?

I hope this helps.

Community
  • 1
  • 1
Salman Khakwani
  • 6,684
  • 7
  • 33
  • 58
  • I did everything in the guide - unfortunately, did not help. The phone (ICS 4.04) have the same problem – lucidyan Mar 30 '14 at 19:49