{ "id": "172971", "key": "TIMOB-26829", "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": "20412", "name": "Release 8.1.0", "archived": false, "released": true, "releaseDate": "2019-08-13" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2019-04-25T12:00:09.000+0000", "created": "2019-02-07T10:29:44.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [], "versions": [ { "id": "20238", "description": "", "name": "Release 7.5.0", "archived": false, "released": true, "releaseDate": "2018-11-15" } ], "issuelinks": [], "assignee": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2019-04-25T12:00:09.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": [], "description": "It works on iOS 10 or later, but fails on iOS 9.3.5\r\n\r\nTo reproduce:\r\n- select a song\r\n- music library will return an item\r\n- stringify will print an empty item\r\n- trying to read the title property on the item crashes the app\r\n\r\n{code:js}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: '#fff'\r\n});\r\n \r\nvar btn = Ti.UI.createButton({\r\n title: 'Trigger'\r\n});\r\n\r\nbtn.addEventListener('click', function() {\r\n if (Ti.Media.hasMusicLibraryPermissions()) {\r\n openMusicLibrary();\r\n } else {\r\n Ti.Media.requestMusicLibraryPermissions(function(e) {\r\n if (!e.success) {\r\n alert(\"No permissions!\");\r\n return;\r\n }\r\n openMusicLibrary();\r\n })\r\n }\r\n});\r\n \r\nwin.add(btn);\r\nwin.open();\r\n \r\nfunction openMusicLibrary() {\r\n Ti.Media.openMusicLibrary({\r\n\t\tallowMultipleSelections : true,\r\n\t\tsuccess : function(event) {\r\n\t\t\t// this will be printed\r\n\t\t Ti.API.info(JSON.stringify(event));\r\n\t\t\t// this crashes the app even if items > 0\r\n \t\tTi.API.info('title = ' + event.items[0].title);\t\r\n\t\t},\r\n\t\tcancel : function() {\r\n\t\t\talert(\"Aborting \");\r\n\t\t},\r\n\t\terror : function(error) {\r\n\t\t\t// called when there's an error\r\n\t\t\tvar a = Titanium.UI.createAlertDialog({\r\n\t\t\t\ttitle : 'Music Library'\r\n\t\t\t});\r\n\t\t\tif (error.code == Titanium.Media.NO_MUSIC_PLAYER) {\r\n\t\t\t\ta.setMessage('Please run this test on device.');\r\n\t\t\t} else {\r\n\t\t\t\ta.setMessage('Unexpected error: ' + error.code);\r\n\t\t\t}\r\n\t\t\ta.show();\r\n\t\t}\r\n\t});\r\n}\r\n{code}", "attachment": [ { "id": "66161", "filename": "log.txt", "author": { "name": "alarocca", "key": "alarocca", "displayName": "alessandro la rocca", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-02-15T07:46:30.000+0000", "size": 8354, "mimeType": "text/plain" }, { "id": "66138", "filename": "log.txt", "author": { "name": "alarocca", "key": "alarocca", "displayName": "alessandro la rocca", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-02-07T11:13:29.000+0000", "size": 101028, "mimeType": "text/plain" }, { "id": "66169", "filename": "New Test 18-2-19 10-19 PM.crash", "author": { "name": "fhaque", "key": "fhaque", "displayName": "Fazlul Haque", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2019-02-18T16:28:01.000+0000", "size": 44511, "mimeType": "application/octet-stream" } ], "flagged": false, "summary": "iOS: Titanium.Media.openMusicLibrary returns empty items on iOS 9.3.5", "creator": { "name": "alarocca", "key": "alarocca", "displayName": "alessandro la rocca", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "alarocca", "key": "alarocca", "displayName": "alessandro la rocca", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Ti 7.5.0.GA\r\nCLI 7.0.9\r\nXCode 10.1", "closedSprints": [ { "id": 1123, "state": "closed", "name": "2019 Sprint 7", "startDate": "2019-03-18T17:27:25.993Z", "endDate": "2019-03-30T17:27:00.000Z", "completeDate": "2019-03-29T18:02:37.441Z", "originBoardId": 114 }, { "id": 1124, "state": "closed", "name": "2019 Sprint 8", "startDate": "2019-03-31T18:03:00.000Z", "endDate": "2019-04-12T18:03:00.000Z", "completeDate": "2019-04-12T19:04:50.175Z", "originBoardId": 114 }, { "id": 1128, "state": "closed", "name": "2019 Sprint 9", "startDate": "2019-04-14T19:05:00.000Z", "endDate": "2019-04-26T19:05:00.000Z", "completeDate": "2019-04-26T22:05:13.933Z", "originBoardId": 114 }, { "id": 1118, "state": "closed", "name": "2019 Sprint 5", "startDate": "2019-02-24T18:36:06.435Z", "endDate": "2019-03-08T18:36:00.000Z", "completeDate": "2019-03-07T22:19:47.057Z", "originBoardId": 114 }, { "id": 1119, "state": "closed", "name": "2019 Sprint 6", "startDate": "2019-03-03T22:20:00.193Z", "endDate": "2019-03-15T22:20:00.000Z", "completeDate": "2019-03-18T17:26:43.120Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "445903", "author": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Hello,\r\nThanks for reporting this. Would you mind providing more information for the issues you are experiencing? It would be great if you can share the complete error logs using the following command:\r\n*appc run -p ios -T simulator -l trace*", "updateAuthor": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2019-02-07T10:59:09.000+0000", "updated": "2019-02-07T10:59:09.000+0000" }, { "id": "445906", "author": { "name": "alarocca", "key": "alarocca", "displayName": "alessandro la rocca", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This is the log directly from my app, not the sample I copied before. Anyway the specific code to get items by music gallery is the same. [^log.txt] \r\n\r\nWhen I try to read the \"title\" property of the first item selected, the app crashes. ", "updateAuthor": { "name": "alarocca", "key": "alarocca", "displayName": "alessandro la rocca", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-02-07T11:14:30.000+0000", "updated": "2019-02-07T11:14:30.000+0000" }, { "id": "446075", "author": { "name": "fhaque", "key": "fhaque", "displayName": "Fazlul Haque", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Hello [~alarocca],\r\n\r\nI have tested this issue on my end and cannot reproduce the same crash on 7.5.0.GA. Please try the below code on your end and let us know. \r\n*Test Code:*\r\napp.js\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor : '#fff'\r\n});\r\n\r\nvar btn = Ti.UI.createButton({\r\n\ttitle : 'Trigger'\r\n});\r\n\r\nbtn.addEventListener('click', function() {\r\n\tif (Ti.Media.hasMusicLibraryPermissions()) {\r\n\t\topenMusicLibrary();\r\n\t} else {\r\n\t\tTi.Media.requestMusicLibraryPermissions(function(e) {\r\n\t\t\tif (!e.success) {\r\n\t\t\t\talert(\"No permissions!\");\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\topenMusicLibrary();\r\n\t\t});\r\n\t}\r\n});\r\n\r\nwin.add(btn);\r\nwin.open();\r\n\r\nfunction openMusicLibrary() {\r\n\tTi.Media.openMusicLibrary({\r\n\t\tallowMultipleSelections : true,\r\n\t\tmediaTypes : Titanium.Media.MUSIC_MEDIA_TYPE_MUSIC | Titanium.Media.MUSIC_MEDIA_TYPE_ANY_AUDIO,\r\n\t\tsuccess : function(event) {\r\n\t\t\t// called when media returned from the MusicLibrary\r\n\t\t\tconsole.log(event.items[0]);\r\n\t\t\tconsole.log(event.items[0].title);\r\n\t\t},\r\n\t\tcancel : function() {\r\n\t\t\talert(\"Aborting \");\r\n\t\t},\r\n\t\terror : function(error) {\r\n\t\t\t// called when there's an error\r\n\t\t\tvar a = Titanium.UI.createAlertDialog({\r\n\t\t\t\ttitle : 'Music Library'\r\n\t\t\t});\r\n\t\t\tif (error.code == Titanium.Media.NO_MUSIC_PLAYER) {\r\n\t\t\t\ta.setMessage('Please run this test on device.');\r\n\t\t\t} else {\r\n\t\t\t\ta.setMessage('Unexpected error: ' + error.code);\r\n\t\t\t}\r\n\t\t\ta.show();\r\n\t\t}\r\n\t});\r\n}\r\n{code}\r\n\r\ntiapp.xml file\r\n{code}\r\n\r\n\t\r\n NSAppleMusicUsageDescription\r\n\tPlay using while you are hiking\r\n\t\r\n\r\n{code}\r\n\r\nThanks", "updateAuthor": { "name": "fhaque", "key": "fhaque", "displayName": "Fazlul Haque", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2019-02-14T19:12:39.000+0000", "updated": "2019-02-14T19:12:39.000+0000" }, { "id": "446090", "author": { "name": "alarocca", "key": "alarocca", "displayName": "alessandro la rocca", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Thanks Fazlul, unfortunately even your code crashes on iOS 9.3.5 while it works on later iOS versions. Did you try it on a device running iOS 9.3.5?\r\n\r\nI just added a log on success to print the event. After this, the app crashes and does not print anything else.\r\n\r\nINFO] : Finished building the application in 10s 626ms\r\n[INFO] : Installing app on device: iPad\r\n[INFO] : App successfully installed on device: iPad\r\nPlease manually launch the application\r\n-- Start application log -----------------------------------------------------\r\n[INFO] : Test 1.0 (Powered by Titanium 7.5.0.2e5a7423d0)\r\n[INFO] : {\"type\":\"success\",\"representative\":{},\"types\":1,\"code\":0,\"success\":true,\"items\":[{}],\"source\":{}}\r\n-- End application log -------------------------------------------------------\r\n\r\n\r\n{code:java}\r\nfunction openMusicLibrary() {\r\n\tTi.Media.openMusicLibrary({\r\n\t\tallowMultipleSelections : true,\r\n\t\tmediaTypes : Titanium.Media.MUSIC_MEDIA_TYPE_MUSIC | Titanium.Media.MUSIC_MEDIA_TYPE_ANY_AUDIO,\r\n\t\tsuccess : function(event) {\r\n\t\t\t// called when media returned from the MusicLibrary\r\n\t\t\tconsole.log(JSON.stringify(event));\r\n\t\t\tconsole.log(event.items[0]);\r\n\t\t\tconsole.log(event.items[0].title);\r\n\t\t},\r\n\t\tcancel : function() {\r\n\t\t\talert(\"Aborting \");\r\n\t\t},\r\n\t\terror : function(error) {\r\n\t\t\t// called when there's an error\r\n\t\t\tvar a = Titanium.UI.createAlertDialog({\r\n\t\t\t\ttitle : 'Music Library'\r\n\t\t\t});\r\n\t\t\tif (error.code == Titanium.Media.NO_MUSIC_PLAYER) {\r\n\t\t\t\ta.setMessage('Please run this test on device.');\r\n\t\t\t} else {\r\n\t\t\t\ta.setMessage('Unexpected error: ' + error.code);\r\n\t\t\t}\r\n\t\t\ta.show();\r\n\t\t}\r\n\t});\r\n}\r\n{code}\r\n\r\n [^log.txt] ", "updateAuthor": { "name": "alarocca", "key": "alarocca", "displayName": "alessandro la rocca", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-02-15T07:51:05.000+0000", "updated": "2019-02-15T07:55:25.000+0000" }, { "id": "446091", "author": { "name": "fhaque", "key": "fhaque", "displayName": "Fazlul Haque", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Hi [~alarocca], Thanks for your feedback. Do you get this crash only iOS version iOS 9.3.5?. If you have any others device can you also check on that device and let us know? Actually, I have tested it upper iOS version", "updateAuthor": { "name": "fhaque", "key": "fhaque", "displayName": "Fazlul Haque", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2019-02-15T08:00:20.000+0000", "updated": "2019-02-15T08:00:20.000+0000" }, { "id": "446092", "author": { "name": "alarocca", "key": "alarocca", "displayName": "alessandro la rocca", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Yes, only iOS 9.3.5 does not work. Upper iOS versions works properly.", "updateAuthor": { "name": "alarocca", "key": "alarocca", "displayName": "alessandro la rocca", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-02-15T08:08:15.000+0000", "updated": "2019-02-15T08:08:15.000+0000" }, { "id": "446097", "author": { "name": "fhaque", "key": "fhaque", "displayName": "Fazlul Haque", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Thanks for the information. Yes, it's not working on iOS 9.3.5. I am going to assign it to our R&D team and they will take an action soon. Thanks", "updateAuthor": { "name": "fhaque", "key": "fhaque", "displayName": "Fazlul Haque", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2019-02-15T13:55:52.000+0000", "updated": "2019-02-15T13:55:52.000+0000" }, { "id": "446363", "author": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/10729", "updateAuthor": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "created": "2019-02-27T16:10:11.000+0000", "updated": "2019-02-27T16:10:11.000+0000" }, { "id": "447736", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed, waiting on Jenkins build.", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-04-17T10:23:01.000+0000", "updated": "2019-04-17T10:23:01.000+0000" }, { "id": "447949", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "*Closing ticket*, changes present in SDK Version {{8.1.0.v20190423134840}}.\r\n\r\nTest and other information can be found at: \r\nhttps://github.com/appcelerator/titanium_mobile/pull/10729\r\n", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-04-25T12:00:04.000+0000", "updated": "2019-04-25T12:00:04.000+0000" } ], "maxResults": 17, "total": 17, "startAt": 0 } } }