eschao / android-PageFlip

3D Style Page Flip on Android
Apache License 2.0
1.74k stars 262 forks source link

Sample not working in the Emulator #5

Closed hegazy closed 7 years ago

hegazy commented 7 years ago

When I open the Sample in the Android Emulator(API 25), it displays a black screen and this error is displayed in the Run tab of the Android Studio. distrib/android-emugl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glDeleteShader:622 error 0x501 and this in logcat

  EGL_emulation  E  tid 5175: eglSurfaceAttrib(1174): error 0x3009 (EGL_BAD_MATCH)
 OpenGLRenderer  W  Failed to set EGL_SWAP_BEHAVIOR on surface 0xa13fd320, error=EGL_BAD_MATCH
       GLShader  E  Can'top compile shader for type: 35632Error: 0
                 E  Compile shader error: ERROR: 0:3: '' : No precision specified for (float)
   PageFlipView  E  Failed to run PageFlipFlipRender:onSurfaceCreated
 LoadBitmapTask  D  Load Queue:0 in background!
                 D  Load Queue:0 in background!
emuglGLESv2_enc  E  device/generic/goldfish-opengl/system/GLESv2_enc/GL2Encoder.cpp:s_glUseProgram:1083 GL error 0x501
                 E  device/generic/goldfish-opengl/system/GLESv2_enc/GL2Encoder.cpp:s_glVertexAttribPointer:290 GL error 0x501
                 E  device/generic/goldfish-opengl/system/GLESv2_enc/GL2Encoder.cpp:s_glEnableVertexAttribArray:469 GL error 0x501
                 E  device/generic/goldfish-opengl/system/GLESv2_enc/GL2Encoder.cpp:s_glVertexAttribPointer:290 GL error 0x501
                 E  device/generic/goldfish-opengl/system/GLESv2_enc/GL2Encoder.cpp:s_glEnableVertexAttribArray:469 GL error 0x501
                 E  device/generic/goldfish-opengl/system/GLESv2_enc/GL2Encoder.cpp:s_glUseProgram:1083 GL error 0x501
                 E  device/generic/goldfish-opengl/system/GLESv2_enc/GL2Encoder.cpp:s_glVertexAttribPointer:290 GL error 0x501
                 E  device/generic/goldfish-opengl/system/GLESv2_enc/GL2Encoder.cpp:s_glEnableVertexAttribArray:469 GL error 0x501
                 E  device/generic/goldfish-opengl/system/GLESv2_enc/GL2Encoder.cpp:s_glVertexAttribPointer:290 GL error 0x501
                 E  device/generic/goldfish-opengl/system/GLESv2_enc/GL2Encoder.cpp:s_glEnableVertexAttribArray:469 GL error 0x501
  Choreographer  I  Skipped 34 frames!  The application may be doing too much work on its main thread.
emuglGLESv2_enc  E  device/generic/goldfish-opengl/system/GLESv2_enc/GL2Encoder.cpp:s_glUseProgram:1083 GL error 0x501
                 E  device/generic/goldfish-opengl/system/GLESv2_enc/GL2Encoder.cpp:s_glVertexAttribPointer:290 GL error 0x501
                 E  device/generic/goldfish-opengl/system/GLESv2_enc/GL2Encoder.cpp:s_glEnableVertexAttribArray:469 GL error 0x501
                 E  device/generic/goldfish-opengl/system/GLESv2_enc/GL2Encoder.cpp:s_glVertexAttribPointer:290 GL error 0x501
                 E  device/generic/goldfish-opengl/system/GLESv2_enc/GL2Encoder.cpp:s_glEnableVertexAttribArray:469 GL error 0x501
eschao commented 7 years ago

Ok, from the output log, seems there is a bug in shader script, I don't know why different Android version has different rules for shader script, but anyway it is an easy problem. Let me try and will fix it ASAP. Thanks!

Berlin-newbee commented 7 years ago

I met this same problem,hope you would find the exact solution as soon as possible

eschao commented 7 years ago

@hegazy & @mcdonaldLiu: I think I got the root cause, that is because I missed "precision mediump float;" in all of GLSL scripts which are located in project folder: res/raw. I've tested it from API 16 to API 25 and will upload it soon. Thanks for your report!

Berlin-newbee commented 7 years ago

well-done, looking forwarding to your fixed verion

eschao commented 7 years ago

@hegazy & @mcdonaldLiu: I think I fixed the bug and updated the codes, please pull the latest codes and try. Any problem please let me know. Thanks!

hegazy commented 7 years ago

@eschao It's fixed now. Thanks 👍

arindammitra06 commented 7 years ago

I am getting this issue on s8 nougat v7

arindammitra06 commented 7 years ago

Can you please help