Skip to content

Instantly share code, notes, and snippets.

@sryze
Last active July 25, 2020 20:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sryze/d629bd536222af63fe32f8387ff5a176 to your computer and use it in GitHub Desktop.
Save sryze/d629bd536222af63fe32f8387ff5a176 to your computer and use it in GitHub Desktop.
Fix WebView crash when running on Android emulator: A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid XXX (RenderThread), pid YYY
val isHardwareAccelerated =
window.attributes.flags and WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED != 0
if (isHardwareAccelerated) {
webView.setLayerType(View.LAYER_TYPE_HARDWARE, null)
} else {
webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment