Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25266] Android: Loading url in WebView crashes on Android 4.1

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2017-10-07T01:43:56.000+0000
Affected Version/sRelease 6.0.0
Fix Version/sRelease 6.3.0
ComponentsAndroid
Labelsandroid, consider-6.2.3, webview
ReporterJoshua Quick
AssigneeGary Mathews
Created2017-09-12T18:22:27.000+0000
Updated2017-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.

Comments

  1. Gary Mathews 2017-09-14

    master: https://github.com/appcelerator/titanium_mobile/pull/9432
  2. Lokesh Choudhary 2017-10-02

    [~gmathews], we will need a backport here.
  3. Lokesh Choudhary 2017-10-03

    FR passed & PR merged for master.
  4. Gary Mathews 2017-10-04

    6_3_X: https://github.com/appcelerator/titanium_mobile/pull/9505
  5. Gary Mathews 2017-10-06

    master: https://github.com/appcelerator/titanium_mobile/pull/9507
  6. Lokesh Choudhary 2017-10-07

    FR's Passed for both the updated PR's
  7. Lokesh Choudhary 2017-10-09

    Verified the fix in SDK 6.3.0.v20171006185117. Waiting for merge to be enabled for master PR.
  8. Lokesh Choudhary 2017-10-25

    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

JSON Source