There is a WebView in my app. Sometimes the WebView crashes after loading url. The crash may occur when executing some js code, since the logcat shows my APP exits unexpectedly after onLoadFinish.
the cash log is:
java.lang.Throwable: jni-crash
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'alps/full_rlk6580_we_c_m/rlk6580_we_c_m:7.1.1/NMF26F/3:user/release-keys'
Revision: '0'
Author: collect by 'libunwind'
ABI: 'arm64-v8a'
pid: 2690, tid: 2835, name: RenderThread >>> my.package.name <<<
signal 7 (SIGBUS), code 1 (BUS_ADRALN), fault addr 0x67616d79
backtrace:
r0 c557d300 r1 67616d69 r2 00000000 r3 01010032
r4 00000001 r5 00000000 r6 00000032 r7 00000001
r8 00000001 r9 c54fd010 r10 00000001 r11 c54d1710
ip cad7f9c4 sp cd46f000 lr 00000001 pc deac6022
#00 pc 007a6022 /system/app/webview/lib/arm/libwebviewchromium.so
--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
and the chromium version is Android 7.1.1 /Chrome 62.0.3202.73
.
This crash does not occur every time when loading the same url. What should I do to prevent this happen and is it possible to catch the exception in Java Code?