[TIMOB-25266] Android: Loading url in WebView crashes on Android 4.1
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-10-07T01:43:56.000+0000 |
Affected Version/s | Release 6.0.0 |
Fix Version/s | Release 6.3.0 |
Components | Android |
Labels | android, consider-6.2.3, webview |
Reporter | Joshua Quick |
Assignee | Gary Mathews |
Created | 2017-09-12T18:22:27.000+0000 |
Updated | 2017-10-25T21:29:32.000+0000 |
Description
*Summary:*
WebView will crash on Android 4.1 when it attempts to load a webpage.
*Test:*
var window = Ti.UI.createWindow();
var webView = Ti.UI.createWebView(
{
url: "https://appcelerator.com",
});
window.add(webView);
window.open();
*Notes:*
- It does not crash on Android 4.2 or newer OS versions.
- It won't crash on Android 4.1 if a webpage has not been loaded. (That is, the "url" has not been set.)
*Cause:*
It crashes when the Canvas.drawPath() methods get called in our "TiBorderWrapperView.java" while hardware acceleration is enabled. So, even though we've never applied a border in the above test code, our WebViewProxy always applies a zero border width to its settings, which is enough to trigger our TiUIView code to go wrap the WebView in a TiBorderWrapperView container.
*Suggested Solution:*
Never draw a border around a WebView on Android 4.1 to work-around this issue.
Note that disabling hardware acceleration will work-around this issue as well, but doing so will prevent HTML5 videos from being seen (see: [TIMOB-23885]), making this a worse solution.
master: https://github.com/appcelerator/titanium_mobile/pull/9432
[~gmathews], we will need a backport here.
FR passed & PR merged for master.
6_3_X: https://github.com/appcelerator/titanium_mobile/pull/9505
master: https://github.com/appcelerator/titanium_mobile/pull/9507
FR's Passed for both the updated PR's
Verified the fix in SDK 6.3.0.v20171006185117. Waiting for merge to be enabled for master PR.
Verified the fix with SDK 7.0.0.v20171025110254. Closing. Studio Ver: 4.10.0.201709271713 SDK Ver: 7.0.0.v20171025110254 OS Ver: 10.12.3 Xcode Ver: Xcode 8.3.3 Appc NPM: 4.2.10-2 Appc CLI: 6.3.0-master.15 Ti CLI Ver: 5.0.14 Alloy Ver: 1.10.6 Node Ver: 7.10.1 Java Ver: 1.8.0_101 Devices: Android 4.1.1