Android Question OpenGL-Application Stops when enabling (gl.GL_COLOR_MATERIAL)

hello friends
i have an application working with openGL library
i have multi panels which includes GLSurfaceView
the application is working well in most android devices, but is stop working in X64 devices. in this case i have to enable lighting in openGL than its not necessary for me. by enabling lighting application will work well but no color appear. when i enable gl.GL_COLOR_MATERIAL it can be effect only on one GLSurfaceView and if i enable for other GLSurfaceView panels i will get app error again
here is the error:


Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 5037 (GLThread 350), pid 4992 (GREAT.DETECTORS)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'Hometech/ALFA_7M/ALFA_7M:8.1.0/O11019/mario9528:user/release-keys'
Revision: '0'
ABI: 'arm'
pid: 4992, tid: 5037, name: GLThread 350 >>> GREAT.DETECTORS <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
Cause: null pointer dereference
r0 ac27f04c r1 00000000 r2 0000004c r3 00000004
r4 9eeca5c1 r5 00000002 r6 00000000 r7 91a9e3c8
r8 939178f0 r9 93916400 sl 00000050 fp 9391791c
ip 80000000 sp 91a9e3c0 lr 9eeca5d1 pc af77ee6c cpsr 80070010
backtrace:
#00 pc 00018e6c /system/lib/libc.so (memcpy+68)
#01 pc 0002e5cd /vendor/lib/egl/libGLESv1_CM_mtk.so
#02 pc 00009ddb /vendor/lib/egl/libGLESv1_CM_mtk.so
#03 pc 0000898b /vendor/lib/egl/libGLESv1_CM_mtk.so
#04 pc 00008043 /vendor/lib/egl/libGLESv1_CM_mtk.so (glDrawArrays+450)
#05 pc 00915f2d /system/framework/arm/boot-framework.oat (offset 0x2fb000) (com.google.android.gles_jni.GLImpl.glDrawArrays [DEDUPED]+92)
#06 pc 00408375 /system/lib/libart.so (art_quick_invoke_stub_internal+68)
#07 pc 0040d4e7 /system/lib/libart.so (art_quick_invoke_stub+230)
#08 pc 000b00b7 /system/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+138)
#09 pc 00202a1d /system/lib/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+220)
#10 pc 001fdf39 /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+588)
#11 pc 003f3113 /system/lib/libart.so (MterpInvokeInterface+1078)
#12 pc 003fa994 /system/lib/libart.so (ExecuteMterpImpl+14740)
#13 pc 001e4db1 /system/lib/libart.so (art::interpreter::Execute(art::Thread*, art:exFile::CodeItem const*, art::ShadowFrame&, art::JValue, bool)+340)
#14 pc 001e9567 /system/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art:exFile::CodeItem const*, art::ShadowFrame*, art::JValue*)+142)
#15 pc 001fdf21 /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+564)
#16 pc 003f49bf /system/lib/libart.so (MterpInvokeVirtualQuick+538)
#17 pc 003fe514 /system/lib/libart.so (ExecuteMterpImpl+29972)
#18 pc 001e4db1 /system/lib/libart.so (art::interpreter::Execute(art::Thread*, art:exFile::CodeItem const*, art::ShadowFrame&, art::JValue, bool)+340)
#19 pc 001e94b5 /system/lib/libart.so (art::interpreter::EnterInterpreterFromEntryPoint(art::Thread*, art:exFile::CodeItem const*, art::ShadowFrame*)+92)
#20 pc 003e7ccd /system/lib/libart.so (artQuickToInterpreterBridge+944)
#21 pc 0040c8f1 /system/lib/libart.so (art_quick_to_interpreter_bridge+32)
#22 pc 00408375 /system/lib/libart.so (art_quick_invoke_stub_internal+68)
#23 pc 0040d4e7 /system/lib/libart.so (art_quick_invoke_stub+230)
#24 pc 000b00b7 /system/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+138)
#25 pc 0035b715 /system/lib/libart.so (art::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::ArgArray*, art::JValue*, char const*)+52)
#26 pc 0035cc47 /system/lib/libart.so (art::InvokeMethod(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jobject*, _jobject*, unsigned int)+942)
#27 pc 0030b085 /system/lib/libart.so (art::Method_invoke(_JNIEnv*, _jobject*, _jobject*, _jobject*)+40)
#28 pc 0011d897 /system/framework/arm/boot.oat (offset 0xd6000) (java.lang.Class.getDeclaredMethodInternal [DEDUPED]+110)
#29 pc 0000edc3 /dev/ashmem/dalvik-jit-code-cache (deleted)
HERE IS MY CODE:
B4X:
Sub glsv_SurfaceCreated(gl As GL1)
    Try
        If DataRecieve.x64=True Then ' in case od the device has  X64 CPU
            gl.glEnable(gl.GL_COLOR_MATERIAL)
            gl.glEnable(gl.GL_LIGHTING)
            gl.glEnable(gl.GL_LIGHT0)
            gl.glEnable(gl.GL_LIGHT1)
            gl.glEnable(gl.GL_LIGHT2)
            gl.glEnable(gl.GL_LIGHT3)
            '
            Dim matAmbient(0),matDiffuse(0) As Float
            matAmbient=Array As Float(0.2,0.2,0.2,1)
            matDiffuse=Array As Float(0.8,0.8,0.8,1)
            gl.glMaterialfv(gl.GL_FRONT_AND_BACK,gl.GL_AMBIENT,matAmbient,0)
            gl.glMaterialfv(gl.GL_FRONT_AND_BACK,gl.GL_DIFFUSE,matDiffuse,0)
            gl.glLightfv(gl.GL_LIGHT0,gl.GL_AMBIENT,matAmbient,0)
            gl.glLightfv(gl.GL_LIGHT1,gl.GL_AMBIENT,matAmbient,0)
            gl.glLightfv(gl.GL_LIGHT2,gl.GL_AMBIENT,matAmbient,0)
            gl.glLightfv(gl.GL_LIGHT3,gl.GL_AMBIENT,matAmbient,0)
            gl.glTexEnvf(gl.GL_TEXTURE_ENV, gl.GL_TEXTURE_ENV_MODE, gl.GL_REPLACE)
        End If
        '=====================================
        gl.glDisable(gl.GL_DEPTH_TEST)
        gl.glDepthFunc(gl.GL_LESS)
        gl.glEnableClientState(gl.GL_VERTEX_ARRAY)
        gl.glEnableClientState (gl.GL_COLOR_ARRAY)
        
        gl.glDisable(gl.GL_DITHER)
        gl.glHint(gl.GL_PERSPECTIVE_CORRECTION_HINT, gl.GL_FASTEST)
        gl.glShadeModel(gl.GL_SMOOTH)
        gl.glEnable(gl.GL_DEPTH_TEST)
        gl.glClearColor(0.8, 0.2, 0.1, 1)
    Catch
        GLException(gl)
    End Try
End Sub
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…