Hi,
We have one of the top crashes in our app related to the WebView render process crash which is caused by the IMA SDK that is not handling it. The WebView rendering process might crash for a variety of reasons and in case where it is not handled by ALL of the WebViewClients implemented in the app or in the libraries used by the app - the app will crash because the render process is shared.
The crash stack trace looks approximately like this:
SIGTRAP: Trace/breakpoint trap
0 libmonochrome.so +0x2827d28 0x7617f90d28
1 libmonochrome.so +0x4c81e60 0x761a3eae64
2 libmonochrome.so +0x332c2d0 0x7618a952d4
3 libmonochrome.so +0x2237404 0x76179a0408
4 libmonochrome.so +0x22357d4 0x761799e7d8
5 libmonochrome.so +0x2c12178 0x761837b17c
6 libmonochrome.so +0x2c120fc 0x761837b100
7 libmonochrome.so +0x2c12048 0x761837b04c
8 libutils.so +0x18070 android::Looper::pollInner(int)
9 libutils.so +0x17c74 android::Looper::pollOnce(int, int*, int*, void**)
10 libandroid_runtime.so +0x13fcc0 android::android_os_MessageQueue_nativePollOnce(_JNIEnv*, _jobject*, long, int)
11 boot-framework.oat +0x2bf1d8 art_jni_trampoline
12 boot-framework.oat +0x76881c android.os.MessageQueue.next
13 boot-framework.oat +0x765654 android.os.Looper.loop
14 boot-framework.oat +0x4eaf80 android.app.ActivityThread.main
15 libart.so +0x1365b4 art_quick_invoke_static_stub
16 libart.so +0x1450c8 art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)
17 libart.so +0x4b1604 art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)
18 libart.so +0x4b304c art::InvokeMethod(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jobject*, _jobject*, unsigned long)
19 libart.so +0x43ed9c art::Method_invoke(_JNIEnv*, _jobject*, _jobject*, _jobjectArray*)
20 boot.oat +0xc2c30 art_jni_trampoline
21 boot-framework.oat +0x9d9274 com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run
22 boot-framework.oat +0x9e15ac com.android.internal.os.ZygoteInit.main
23 libart.so +0x1365b4 art_quick_invoke_static_stub
24 libart.so +0x1450c8 art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)
25 libart.so +0x4b1604 art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)
26 libart.so +0x4b1264 art::InvokeWithVarArgs(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, std::__va_list)
27 libart.so +0x3bba34 art::JNI::CallStaticVoidMethodV(_JNIEnv*, _jclass*, _jmethodID*, std::__va_list)
28 libandroid_runtime.so +0xc59d8 _JNIEnv::CallStaticVoidMethod(_jclass*, _jmethodID*, ...)
29 libandroid_runtime.so +0xc887c android::AndroidRuntime::start(char const*, android::Vector<android::String8> const&, bool)
30 app_process64 +0x3598 main
31 libc.so +0x7e868 __libc_init
I've shared the sample app for you to check. It is the modified project from the IMA library samples.
Steps to reproduce:
1. Launch the sample app.
2. Launch the ad playback.
3. Push the floating action button which is launching the WebView with "chrome://crash" URL.
4. Observe the crash.
To handle this crash the WebViewClient used in the IMA library has to override the onRenderProcessGone method and return "true" there which is not the case currently.
Can you please fix it and override this method in the WebViewClient ?