Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-25266

Android: Loading url in WebView crashes on Android 4.1

    Details

    • Story Points:
      3
    • Sprint:
      2017 Sprint 19 SDK, 2017 Sprint 20 SDK

      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.

        Attachments

          Activity

            People

            • Assignee:
              gmathews Gary Mathews
              Reporter:
              jquick Joshua Quick
              Reviewer:
              Joshua Quick
              Tester:
              Lokesh Choudhary
            • Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-11132
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Source Code