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

Android: HTTP requests broken on Android 10+

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Cannot Reproduce
    • Affects Version/s: Release 8.2.0
    • Fix Version/s: None
    • Component/s: Android
    • Labels:
      None

      Description

      On Android 10, the following request never triggers a callback (neither success nor error):

      function sendRequest() {
      	var url = "http://www.appcelerator.com";
      	var client = Ti.Network.createHTTPClient({
      		// function called when the response data is available
      		onload : function(e) {
      			Ti.API.info("Received text: " + this.responseText);
      			alert('success');
      		},
      		// function called when an error occurs, including a timeout
      		onerror : function(e) {
      			Ti.API.debug(e.error);
      			alert('error');
      		},
      		timeout : 5000  // in milliseconds
      	});
      	// Prepare the connection.
      	client.open("GET", url);
      	// Send the request.
      	client.send();
      }
       
      var win = Ti.UI.createWindow({
          backgroundColor: '#fff'
      });
       
      var btn = Ti.UI.createButton({
          title: 'Send request!'
      });
       
      btn.addEventListener('click', function () {
          sendRequest();
      });
       
      win.add(btn);
      win.open();
      

      The same request works fine on Android < 10. We hope it just requires some kind of whitelisting like ATS on iOS.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              hknoechel Hans Knöchel
            • Watchers:
              14 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                  Git Source Code