2017-03-21 82 views
1

我正在構建一個包含幾個webview的Android應用程序。根據this,該應用需要支持至少嵌入鉻v30 webview的KitKat 4.4。我測試的三星Galaxy Note 2運行4.4.2股票ROM中的應用,web視圖運行速度非常緩慢,logcat的是洪水與以下錯誤信息:Android KitKat 4.4 Chromium WebView「v8_value_converter_impl.cc」錯誤

... 
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)嵌入到應用程序之外,還有其他方法可以修復/解決此問題嗎?

+0

即時通訊想知道是否有方法更新kitkat中的webview的鉻版本。任何人? – user1506104

回答

1

我找到了問題的根源。我在onProgressChanged回調中添加了一些沉重的js任務,他們會輸出一個空對象。該空對象無法序列化並導致this chromium ticket中的錯誤。作爲一種解決方法,我用IIFE包裝了所有js調用,以便使用Guava的RateLimiter來緩存輸出並在onProgressChanged中調節js調用。

相關問題