1

I am building an Android app which contains a couple of webview. The app needs to support KitKat 4.4 at minimum which embeds chromium v30 webview according to this. I am testing the app on Samsung Galaxy Note 2 running 4.4.2 stock rom, the webview runs very slowly and the logcat is flood with the below error messages:

...
03-21 14:11:48.651 29445-29445/com.mylovely.app I/GraphicBuffer: allocate buffer (w:384 h:384 f:1) handle(0x6f64b600) err(0)
03-21 14:11:48.652 29445-29445/com.mylovely.app I/GraphicBuffer: allocate buffer (w:384 h:384 f:1) handle(0x6d715280) err(0)
03-21 14:11:48.652 29445-29445/com.mylovely.app I/GraphicBuffer: allocate buffer (w:128 h:192 f:1) handle(0x6dd99590) err(0)
03-21 14:12:03.996 29445-29884/com.mylovely.app E/chromium: [ERROR:v8_value_converter_impl.cc(405)] Getter for property selectionDirection threw an exception.
03-21 14:12:03.996 29445-29884/com.mylovely.app E/chromium: [ERROR:v8_value_converter_impl.cc(405)] Getter for property selectionEnd threw an exception.
03-21 14:12:03.996 29445-29884/com.mylovely.app E/chromium: [ERROR:v8_value_converter_impl.cc(405)] Getter for property selectionStart threw an exception.
03-21 14:12:04.007 29445-29884/com.mylovely.app E/chromium: [ERROR:v8_value_converter_impl.cc(405)] Getter for property selectionDirection threw an exception.
03-21 14:12:04.007 29445-29884/com.mylovely.app E/chromium: [ERROR:v8_value_converter_impl.cc(405)] Getter for property selectionEnd threw an exception.
03-21 14:12:04.007 29445-29884/com.mylovely.app E/chromium: [ERROR:v8_value_converter_impl.cc(405)] Getter for property selectionStart threw an exception.
... <skipped lots of duplicated error here>

03-21 14:12:05.370 29445-29445/com.mylovely.app I/dalvikvm-heap: Grow heap (frag case) to 41.055MB for 11211498-byte allocation
03-21 14:12:06.285 29445-29445/com.mylovely.app I/dalvikvm-heap: Grow heap (frag case) to 34.448MB for 4285074-byte allocation
03-21 14:12:06.354 29445-29445/com.mylovely.app I/Choreographer: Skipped 41 frames!  The application may be doing too much work on its main thread.
03-21 14:12:06.356 29445-29445/com.mylovely.app I/GraphicBuffer: allocate buffer (w:384 h:384 f:1) handle(0x637baab0) err(0)
03-21 14:12:06.358 29445-29445/com.mylovely.app I/GraphicBuffer: allocate buffer (w:384 h:384 f:1) handle(0x6e7ee640) err(0)
...

I already did some googling and found this seems to be fixed this chromium ticket. But since we cannot update the system webview under 4.4.2 through Google Play. Is there any other way to fix / workaround this issue beside embedding other webview (like crosswalk) to the app?

chub
  • 5,131
  • 4
  • 35
  • 59

1 Answers1

1

I found out the root cause of the issue. I added some heavy js tasks in the onProgressChanged callback, which they would output an null object. This null object could not be serialized and causing the bug in this chromium ticket. As a workaround, I wrapped all the js calls with IIFE to slient the output and throttle the js calls in onProgressChanged using Guava's RateLimiter.

Community
  • 1
  • 1
chub
  • 5,131
  • 4
  • 35
  • 59