Native crashes on abort in developer console with Oreo (8.1)

that a Surface is being used hints for OpenGL ES and GLSurfaceView – which extends View.

a possible workaround might be to disable hardware acceleration for the views, which cause it to crash on Android 8.1 and 9.0 (as libhwui.so hints for) – because even if it gets fixed, any device not updated will still keep crashing. this can be done per View (see the documentation):

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) {
    mSurface.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
}

of course, this would result in sub-optimal performance; but still better than a crash.

Leave a Comment

tech