https://kotlinlang.org logo
#compose
Title
# compose
c

Chris Johnson

01/25/2023, 1:53 AM
Running in to a really weird crash with compose WebView. When navigating away from a screen that has a webview on it, we're getting a native crash related to "null pointer dereference". I've done a lot of googling and see it happens in the react framework often. Their solutions have not proven useful / are specific to that framework. I was wondering if anyone else has seen this crash and has fixed it? Our current compose version is
1.4.0-alpha02
and accompanist is
0.25.0
. Setting the WebView's layer to
View.LAYER_TYPE_SOFTWARE
does fix it, but the webpage is then blank. I'll post the the start of the stacktrace in 🧵 EDIT: Workaround found
👀 1
Copy code
00 pc 000000000048e47c  /system/lib64/libhwui.so (SkSurface_Base::getCachedCanvas()+16) (BuildId: 31b5b473e5c68e0d0aef2c20a1aa8daa)
2023-01-24 17:50:55.191 17751-17751 DEBUG                   crash_dump64                         A        #01 pc 0000000000598db0  /system/lib64/libhwui.so (android::uirenderer::skiapipeline::GLFunctorDrawable::onDraw(SkCanvas*)+1856) (BuildId: 31b5b473e5c68e0d0aef2c20a1aa8daa)
2023-01-24 17:50:55.191 17751-17751 DEBUG                   crash_dump64                         A        #02 pc 000000000048c44c  /system/lib64/libhwui.so (SkDrawable::draw(SkCanvas*, SkMatrix const*)+124) (BuildId: 31b5b473e5c68e0d0aef2c20a1aa8daa)
2023-01-24 17:50:55.191 17751-17751 DEBUG                   crash_dump64                         A
Workaround was to set the webview's alpha to .99f inside the factory portion of the
AndroidView
composable. 😓
69 Views