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

Android: KitKat crash when calling WebView method on wrong thread

    Details

      Description

      The following code crashes on Android 4.4, does not crash on Android 4.1.2.
      The crash log is:
      11-20 22:32:31.861: E/TiExceptionHandler(9656): (main) [0,995] - Message: Uncaught Error: java.lang.Throwable: A WebView method was called on thread 'KrollRuntimeThread'. All WebView methods must be called on the same thread. (Expected Looper Looper

      {41e338c0} called on Looper{41e52348}, FYI main Looper is Looper{41e338c0}

      )
      11-20 22:32:31.861: E/TiExceptionHandler(9656): (main) [0,995] - Source: Ti.API.debug("user agent: " + $.webview.userAgent);

      index.xml:

      <Alloy>
      	<Window class="container" fullscreen=true>
      		<WebView id="webview" url="/test.html" />
      	</Window>
      </Alloy>
      

      index.js:

      Ti.API.debug('user agent: ' + $.webview.userAgent); // CRASH HERE ON KitKat
       
      $.index.open();
      

      lib/test.html

      <!DOCTYPE html>
      <html>
      <head>
      </head>
      <body>
      	<h2>Hi there</h2>
      </body>
      </html>
      

        Attachments

          Activity

            People

            • Assignee:
              ayeung Allen Yeung
              Reporter:
              mokesmokes Mark Mokryn
              Reviewer:
              Hieu Pham
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Source Code