[TIMOB-24737] Android: Reading property "WebView.disableContextMenu" causes crash if never assigned
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-05-26T18:46:12.000+0000 |
Affected Version/s | Release 6.1.0 |
Fix Version/s | Release 6.1.0 |
Components | Android |
Labels | android, regression, webview |
Reporter | Anthony Chung |
Assignee | Gary Mathews |
Created | 2017-05-25T18:06:38.000+0000 |
Updated | 2017-06-14T17:58:45.000+0000 |
Description
*Edit from [~jquick]:*
The stack-trace indicates that this is actually a WebView bug, not a ListView bug. Please see my comment below this post.
*Original Post:*
Please check/test 6.1.0.Rc on Android with Listview error, console log attached with file.
This error occurs when I use 6.1.0.RC with a listview in our production app.
Switching back to 6.0.4.GA, the error goes away.
Version I was testing with
6.1.0.v20170524102117
iOS does not seem to be affected. Only on Android.
Cannot share full code as production code.
Listview has a headerView.
ListItem is...
var listitem = {
template: 'template',
title: {text: item.title},
subtitle: {text: item.subtitle},
properties: {
accessoryType: Ti.UI.LIST_ACCESSORY_TYPE_DISCLOSURE,
itemId: item.itemId,
modname: item.modname,
resourcetype: item.template
}
};
Output:
[WARN] : W/System.err: java.lang.IllegalArgumentException: Unable to convert null to boolean.
[WARN] : W/System.err: at org.appcelerator.titanium.util.TiConvert.toBoolean(TiConvert.java:357)
[WARN] : W/System.err: at ti.modules.titanium.ui.WebViewProxy.getDisableContextMenu(WebViewProxy.java:354)
[WARN] : W/System.err: at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method)
[WARN] : W/System.err: at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62)
[WARN] : W/System.err: at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:872)
[WARN] : W/System.err: at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1095)
[WARN] : W/System.err: at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:360)
[WARN] : W/System.err: at ti.modules.titanium.ui.widget.listview.ListViewProxy.handleMessage(ListViewProxy.java:320)
[WARN] : W/System.err: at android.os.Handler.dispatchMessage(Handler.java:98)
[WARN] : W/System.err: at android.os.Looper.loop(Looper.java:148)
[WARN] : W/System.err: at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:118)
[ERROR] : TiExceptionHandler: (main) [103,25598] ----- Titanium Javascript Runtime Error -----
[ERROR] : TiExceptionHandler: (main) [0,25598] - In ti:/titanium.js:207,24
[ERROR] : TiExceptionHandler: (main) [0,25598] - Message: Uncaught Unable to convert null to boolean.
[ERROR] : TiExceptionHandler: (main) [0,25598] - Source: serialized[k] = this[k];
[DEBUG] : ViewRootImpl: #1 mView = com.android.internal.policy.PhoneWindow$DecorView{99b1dd3 V.E...... R.....I. 0,0-0,0}
[ERROR] : V8Exception: Exception occurred at ti:/titanium.js:207: Uncaught Unable to convert null to boolean.
[ERROR] : V8Exception: Unable to convert null to boolean.
[WARN] : TiBlob: (KrollRuntimeThread) [41,25639] getNativePath not supported for non-file blob types.
[WARN] : TiBlob: (KrollRuntimeThread) [0,25639] getFile not supported for non-file blob types.
In the production scenario where error is occuring: The headerview being applied to listsection headerview in this scenario is an Android webview.
Looks like an issue inside the Web-View (do you embed one in your list-view)? Especially, do you use the
disableContextMenu
property? If you use the web-view inside the list-view, but don't use the above property, it may be something with default-values.I've confirmed that this is a WebView bug. It crashes when reading the "WebView.disableContextMenu" property if the property was never assigned. The following code reproduces this issue:
We're looking into fixing this bug now. Thanks for reporting this issue. *Work-around:* Set the "disableContextMenu" property to true/false in your createWebView() function call.
[~jquick] Sorry, I forgot to mark it as
In Progress
when I assigned it to myself. It's an easy fix, I'm not sure if this issue is a regression though. master: https://github.com/appcelerator/titanium_mobile/pull/9092 6_1_X: https://github.com/appcelerator/titanium_mobile/pull/9093Closing ticket as fix is verified in 6.1.0.GA, 6.1.1.v20170609153006 and 6.2.0.v20170612114319. Test and other information can be found at: master: https://github.com/appcelerator/titanium_mobile/pull/9092 6_1_X: https://github.com/appcelerator/titanium_mobile/pull/9093