[Android] ' webview--caught a crash, signum=11 ' 's solution

Source: Internet
Author: User

Encounter a strange problem:
WebView display a local H5 page, in Mi 2S can be displayed, the same properties on the page button has two clickable, but the third button click Cause activity must crash. Crash without verbose log, only the following two lines of clues:

// W/crash_handler(19125): Caught a crash, signum=11
// 14594-14594/com.eln.base E/webcore: Report WebCore crash to the ErrorReportUtils at:Wed Oct 28 18:44:51 格林尼治标准时间+0800 2015 //blog from sodino.com

This page is normal for other phones, including Xiaomi, which only appears in Mi 2S.

H5 developer Follow-up found that the crash point is a crash in the rendering phase of the H5 interface, and no further workaround.
Go to dinner while walking on the road considering that Android and rendering are related to hardware acceleration ;
Check the code back to find the entire app in AndroidManifest.xml the application label at global turn on hardware acceleration,
So when the hardware acceleration switch is set to OFF, the webview is found to be android:hardwareAccelerated="false" normal.

Subsequent to further reduce the scope of the impact of code churn, the solution to circumvent this bug is set to:
1. When determining the MI 2 series phone
2. Turn off hardware acceleration for the WebView interface


// if ("MI 2SC".equals(deviceName)) {
if (deviceName!= null && deviceName.toLowerCase().startsWith("mi 2")) {
mWebView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
}

Attached: [Android official hardware acceleration Control level description on different interfaces] (
http://developer.android.com/intl/zh-cn/guide/topics/graphics/hardware-accel.html)

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

[Android] ' webview--caught a crash, signum=11 ' 's solution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.