hardwareAccelerated硬件加速引起黑屏或glViewport error! GL_INVALID_VALUE (0x501)的crash

1.之前遇到个App主页黑屏但是投屏工具或者截屏工具可以显示出来的问题,很早之前版本是可以的,于是挨个版本对比,终于查出来是在Manfest里Application关闭了hardwareAccelerated引起的,于是设置为true问题解决了。但是不久就开始报各种crash,如下

02-22 05:03:34.897 5735 6089 F libc : Fatal signal 6 (SIGABRT), code -6 in tid 6089 (RenderThread), pid 5735 (PACKAGENAME) 02-22 
05:03:35.005 7133 7133 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 
02-22 05:03:35.005 7133 7133 F DEBUG : Build fingerprint: 'EBO/dylcr/dylcr:8.1.0/OPM5.171019.015/4:userdebug/test-keys' 
02-22 05:03:35.005 7133 7133 F DEBUG : Revision: '1.1' 
02-22 05:03:35.005 7133 7133 F DEBUG : ABI: 'arm64' 
02-22 05:03:35.005 7133 7133 F DEBUG : pid: 5735, tid: 6089, name: RenderThread >>> PACKAGENAME <<< 
02-22 05:03:35.005 7133 7133 F DEBUG : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr -------- 
02-22 05:03:35.008 7133 7133 F DEBUG : Abort message: 'glViewport error! GL_INVALID_VALUE (0x501)' 02-22 05:03:35.008 7133 7133 F DEBUG : x0 0000000000000000 x1 00000000000017c9 x2 0000000000000006 x3 0000000000000008 
02-22 05:03:35.008 7133 7133 F DEBUG : x4 2b00000000000000 x5 2b00000000000000 x6 2b00000000000000 x7 000000000000802b 
02-22 05:03:35.008 7133 7133 F DEBUG : x8 0000000000000083 x9 0000000010000000 x10 0000f9069b5fe5e0 x11 0000000000000001 
02-22 05:03:35.008 7133 7133 F DEBUG : x12 0000f9069b5fe700 x13 0000000000000001 x14 ffffffffffffffff x15 2b00000000000000 
02-22 05:03:35.009 7133 7133 F DEBUG : x16 0000c84491f46fa8 x17 0000f907312494b8 x18 0000000000000000 x19 0000000000001667 
02-22 05:03:35.009 7133 7133 F DEBUG : x20 00000000000017c9 x21 0000000000000083 x22 0000f90730901fe0 x23 0000000000000502 
02-22 05:03:35.009 7133 7133 F DEBUG : x24 0000f907309020ae x25 0000000000000505 x26 0000f90730902094 x27 0000000000000501 
02-22 05:03:35.009 7133 7133 F DEBUG : x28 0000f9073090204e x29 0000f9069b5fe620 x30 0000f907311fe6ec 
02-22 05:03:35.009 7133 7133 F DEBUG : sp 0000f9069b5fe5e0 pc 0000f907311fe714 pstate 0000000060000000 02-22 05:03:35.074 7133 7133 F DEBUG : 
02-22 05:03:35.074 7133 7133 F DEBUG : backtrace: 02-22 05:03:35.074 7133 7133 F DEBUG : #00 pc 000000000001d714 /system/lib64/libc.so (abort+120) 02-22 05:03:35.074 7133 7133 F DEBUG : #01 pc 0000000000007f08 /system/lib64/liblog.so (_android_log_assert+296) 
02-22 05:03:35.074 7133 7133 F DEBUG : #02 pc 000000000004651c /system/lib64/libhwui.so 
...

从上面log看主要错误是glViewport error! GL_INVALID_VALUE (0x501),网上查都说是OpenGL调用Rander API不对(https://stackoverflow.com/questions/11299643/openg-gl-2-0-android-error-0x501-gl-invalid-value),有说关闭硬件加速就可以解决,但是app默认就是开启硬件加速的,应该不会有问题。遇到此问题应该是native层出问题了。

你可能感兴趣的:(hardwareAccelerated硬件加速引起黑屏或glViewport error! GL_INVALID_VALUE (0x501)的crash)