{ "id": "173782", "key": "TIMOB-27168", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2019-10-28T19:00:06.000+0000", "created": "2019-06-19T13:53:05.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [], "versions": [ { "id": "20827", "name": "Release 8.2.0", "archived": false, "released": true, "releaseDate": "2019-09-19" } ], "issuelinks": [], "assignee": null, "updated": "2019-10-28T19:05:02.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "On Android 10, the following request never triggers a callback (neither {{success}} nor {{error}}):\r\n{code:js}\r\nfunction sendRequest() {\r\n\tvar url = \"http://www.appcelerator.com\";\r\n\tvar client = Ti.Network.createHTTPClient({\r\n\t\t// function called when the response data is available\r\n\t\tonload : function(e) {\r\n\t\t\tTi.API.info(\"Received text: \" + this.responseText);\r\n\t\t\talert('success');\r\n\t\t},\r\n\t\t// function called when an error occurs, including a timeout\r\n\t\tonerror : function(e) {\r\n\t\t\tTi.API.debug(e.error);\r\n\t\t\talert('error');\r\n\t\t},\r\n\t\ttimeout : 5000 // in milliseconds\r\n\t});\r\n\t// Prepare the connection.\r\n\tclient.open(\"GET\", url);\r\n\t// Send the request.\r\n\tclient.send();\r\n}\r\n\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: '#fff'\r\n});\r\n\r\nvar btn = Ti.UI.createButton({\r\n title: 'Send request!'\r\n});\r\n\r\nbtn.addEventListener('click', function () {\r\n sendRequest();\r\n});\r\n\r\nwin.add(btn);\r\nwin.open();\r\n{code}\r\nThe same request works fine on Android < 10. We hope it just requires some kind of whitelisting like ATS on iOS.", "attachment": [], "flagged": false, "summary": "Android: HTTP requests broken on Android 10+", "creator": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "comment": { "comments": [ { "id": "449208", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~hknoechel], this works for me in my Android 10 emulator. The \"onload\" callback was successfully invoked when the HTTP response was received.\r\n\r\nI even tried a ridiculously short 10ms timeout and verified that the timeout correctly invokes the \"onerror\" callback.\r\n\r\nWhat I find interesting about your test code is the \"http://www.appcelerator.com\" URL. That will cause the server to respond with a redirect to the equivalent HTTPS URL. Switching between http/https protocols is normally considered a security issue on ALL platforms (Android, iOS, Windows) and involves us writing code to handle the redirect response ourselves... which we do.\r\nhttps://github.com/appcelerator/titanium_mobile/blob/master/android/modules/network/src/java/ti/modules/titanium/network/TiHTTPClient.java#L1330\r\n\r\nDo you see errors in the log that might help?", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-06-19T18:30:29.000+0000", "updated": "2019-06-19T18:30:29.000+0000" }, { "id": "449275", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "With {{android:usesCleartextTraffic}} specified, I'm also able to receive a response from the {{onload}} callback. Although, this is enabled by default.\r\n\r\n{code:xml}\r\n\r\n{code}", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-06-21T22:08:39.000+0000", "updated": "2019-06-21T22:11:50.000+0000" }, { "id": "449276", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "I was only able to reproduce it on one emulator so far. Maybe this setting was misconfigured there? And would you recommend forcing it to {{true}}?", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2019-06-21T22:36:17.000+0000", "updated": "2019-06-21T22:36:17.000+0000" }, { "id": "449280", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-06-22T07:34:59.000+0000", "updated": "2019-06-22T07:36:10.000+0000" }, { "id": "449281", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "There is no such setting in our app right now, so I guess it's an emulator issue. Does Axway run Android Q emulators for their unit tests already? Would be good to run all tests with it by now.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2019-06-22T10:39:42.000+0000", "updated": "2019-06-22T10:39:42.000+0000" }, { "id": "449298", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "bq. There is no such setting in our app right now\r\n\r\nI'm not sure what you mean by that. Can you double check the \"AndroidManifest.xml\" file generated under your project's \"./build/android\" directory please? Look for the {{}} XML element's \"usesCleartextTraffic\" attribute and make sure it is set to \"true\". If it's not there, then that's the issue. This attribute being missing will cause \"http\" communications to fail on Android P and above.\r\n\r\nbq. Does Axway run Android Q emulators for their unit tests already?\r\n\r\nNot yet. We currently run our test suite on Android 9.0 and Android 4.4. We also test on real physical devices as well.\r\n\r\nThat said, I've personally ran our mocha unit test suite kitchensink-v2 via the Android Q emulator. The only issue I ran into was with reading JSON and JavaScript via a {{Ti.Blob}}, which we've resolved by [TIMOB-26954]. And yes, our mocha \"HTTPClient\" unit tests covers HTTP to HTTPS redirects.\r\n\r\nAlso note that we don't support \"targeting\" Android Q (aka: API Level 29) yet. We plan on targeting it in Titanium 8.3.0. You will run into breaking-changes if you target it (we have to address these breaking-changes in 8.3.0). But so far, a Titanium 8.1.0 build which targets Android P by default has proven to be backward compatible on Android Q.\r\n", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-06-24T19:05:17.000+0000", "updated": "2019-06-24T19:05:17.000+0000" }, { "id": "452314", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "We still can't reproduce this issue.\r\n\r\nWe've done extensive testing with 2 physical Android Q devices and in the emulator. It's working. We've also tested TLS 1.3 support as well.\r\n\r\nSo, I'm going to close this issue and assume it was caused by something else.\r\n(Most likely the JSON file reading issue we used to have on Android Q that was solved a while ago.)", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-10-28T18:59:59.000+0000", "updated": "2019-10-28T18:59:59.000+0000" }, { "id": "452315", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "This did not happen again, so yeah, most likely it's fixed by now. Thanks again for checking!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2019-10-28T19:01:54.000+0000", "updated": "2019-10-28T19:01:54.000+0000" }, { "id": "452316", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Good to know it's not happening to you anymore. Thanks for this.\r\n(We're just following-up on our remaining Android Q tickets.)", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-10-28T19:05:02.000+0000", "updated": "2019-10-28T19:05:02.000+0000" } ], "maxResults": 10, "total": 10, "startAt": 0 } } }