简体   繁体   English

Android 6 + WebView + Rangy库= SIGSEGV崩溃

[英]Android 6 + WebView + Rangy library = SIGSEGV Crash

Im using Webview + Rangy Class Applier Module (by Tim) 我正在使用Webview + Rangy Class Applier模块(作者Tim)

after a button click, it load a javascript webview.loadUrl("javascript:applyColor(color1)"); 单击按钮后,它会加载javascript webview.loadUrl("javascript:applyColor(color1)");

and the function 和功能

function applyColor(colorCSSClass) {
applier = rangy.createClassApplier(colorCSSClass);
applier.toggleSelection();
//Remove Other css colours
}

and for some weird reason, after some applied colors the app crash and i receive this error : 出于某种奇怪的原因,在应用了某些颜色后,应用程序崩溃了,我收到此错误:

 W/Adreno-GSL: <gsl_ldd_control:475>: ioctl fd 36 code 0x40180917 (IOCTL_KGSL_CMDSTREAM_FREEMEMONTIMESTAMP_CTXTID) failed: errno 16 Device or resource busy
    W/Adreno-GSL: <gsl_ldd_control:475>: ioctl fd 36 code 0x40180917 (IOCTL_KGSL_CMDSTREAM_FREEMEMONTIMESTAMP_CTXTID) failed: errno 16 Device or resource busy
    W/google-breakpad: ### ### ### ### ### ### ### ### ### ### ### ### ###
    W/google-breakpad: Chrome build fingerprint:
    W/google-breakpad: 3.0.0.5
    W/google-breakpad: 3005
    W/google-breakpad: ### ### ### ### ### ### ### ### ### ### ### ### ###
    A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x7b in tid 25790 (RenderThread)
    D/HyLog: D: Wrong tag (927 : loadPreData() : frameworks/base/core/jni/android/graphics/TypefaceHyFontManager.cpp)

UPDATE: this error does not occurs in Android 5.1 更新:Android 5.1中不会发生此错误

FOUND THE SOLUTION, ITS A OLD PROBLEM, occurs for some people and for others not, for me was in android 6.0 发现了解决方案,这是一个老问题,对于某些人而言,而对于其他人则不然,因为我在android 6.0中

The Solution: 解决方案:

webview.load... //load your html

than after the loading: 比加载后:

                webview.setBackgroundColor(Color.TRANSPARENT);
                Paint p = new Paint();
                webview.setLayerType(View.LAYER_TYPE_SOFTWARE, p);

It seems to hit a little performance when you talk about Smooth scrolling, dont know if its version related or is there any fix, if i find or someone, please, post here 当您谈论平滑滚动时,似乎性能有所下降,不知道其版本是否相关或是否有任何修复,如果我找到或有人,请在此处发布

no crashs anymore after this 此后不再崩溃

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM