{ "id": "171989", "key": "TIMOB-26249", "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": [ { "id": "20238", "description": "", "name": "Release 7.5.0", "archived": false, "released": true, "releaseDate": "2018-11-15" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-08-24T01:15:45.000+0000", "created": "2018-07-31T22:53:02.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "ImageView", "android", "url" ], "versions": [], "issuelinks": [], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-08-24T01:15:49.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": "*Summary:*\r\nThe Android {{ImageView}} will cause a crash if you set \"image\" to a URL, \"autorotate\" to {{true}}, and the JavaScript runtime is set up to run on the main UI thread.\r\n\r\n*Steps to reproduce:*\r\n# Uninstall the app from the device if already installed. (Will delete cached web responses.)\r\n# Make sure the Android device has Internet access.\r\n# Set \"tiapp.xml\" file property \"run-on-main-thread\" to {{true}}.\r\n# Build and run the below code.\r\n# Notice that the app crashes/hangs on app startup.\r\n\r\ntiapp.xml\r\n{code:xml}\r\n\r\n\r\n\ttrue\r\n\r\n{code}\r\n\r\napp.js\r\n{code:javascript}\r\nvar window = Ti.UI.createWindow();\r\nwindow.add(Ti.UI.createImageView({\r\n\timage: \"https://raw.githubusercontent.com/recurser/exif-orientation-examples/master/Portrait_3.jpg\",\r\n\tautorotate: true,\r\n}));\r\nwindow.open();\r\n{code}\r\n\r\n*Cause:*\r\nWhen the {{ImageView}} property {{autorotate}} is set to true, it will attempt to read the image's EXIF rotation if applicable. Since the image file is not in storage, it will attempt to re-download the image on the main UI thread, but Android's Java {{HttpUrlConnection}} class will throw a {{NetworkOnMainThreadException}} when attempting to do so.\r\n\r\n*Work-arounds:*\r\nYou can do one of the following to work-around this issue...\r\n* Set \"tiapp.xml\" property \"run-on-main-thread\" to {{false}}.\r\n* Download the image file to storage via {{HTTPClient}} and display the download file instead of a URL.\r\n* Set {{ImageView}} property \"autorotate\" to {{false}}.\r\n", "attachment": [], "flagged": false, "summary": "Android: ImageView \"image\" set to a URL while \"autorotate\" is true will crash if running on main thread", "creator": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "closedSprints": [ { "id": 1058, "state": "closed", "name": "2018 Sprint 16 SDK", "startDate": "2018-07-29T22:26:06.486Z", "endDate": "2018-08-12T22:26:00.000Z", "completeDate": "2018-08-13T17:38:16.757Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "439635", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/10222", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-08-01T04:34:22.000+0000", "updated": "2018-08-01T04:34:22.000+0000" }, { "id": "440744", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as fix has been tested as part of TIMOB-24605.", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-08-14T10:56:52.000+0000", "updated": "2018-08-14T10:56:52.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }