Android KitKat 4.4 Chromium WebView“v8_value_converter_impl.cc”错误

时间:2017-03-21 06:25:13

标签: android webview chromium

我正在构建一个包含几个webview的Android应用程序。该应用程序至少需要支持KitKat 4.4,它根据this嵌入了chrome v30 webview。我在运行4.4.2 stock rom的三星Galaxy Note 2上测试应用程序,webview运行速度非常慢,logcat充斥着以下错误消息:

...
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)
...

我已经做了一些谷歌搜索,发现这似乎是固定的this chromium ticket。但由于我们无法通过Google Play更新4.4.2下的系统webview。除了将其他webview(如crosswalk)嵌入应用程序之外,还有其他方法可以修复/解决此问题吗?

1 个答案:

答案 0 :(得分:1)

我找到了问题的根本原因。我在onProgressChanged回调中添加了一些重js任务,它们会输出一个空对象。此null对象无法序列化并导致this chromium ticket中的错误。作为一种解决方法,我使用IIFE将所有js调用包装起来,以便使用Guava&#39; onProgressChanged来调整输出并限制RateLimiter中的js调用。