{ "id": "140480", "key": "TIMOB-18086", "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": null, "resolutiondate": null, "created": "2014-11-25T10:33:30.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [ "qe-3.5.0" ], "versions": [ { "id": "16704", "description": "Release 3.5.0", "name": "Release 3.5.0", "archived": false, "released": true, "releaseDate": "2015-01-13" } ], "issuelinks": [], "assignee": null, "updated": "2018-02-28T19:55:19.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "Description:\r\n\r\nIn the below test case, getFile() method of Filesystem is used for returning the file present at apps Resources folder. \r\nThe application crashes when tried to open the return file object by using its open() method.\r\n \r\nThis is not a regression as able to reproduce it with 3.4.0 GA and 3.3.0.GA.\r\n\r\nTestCase:\r\nvar f = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, 'acceptance.js');\r\nvar stream = f.open(Ti.Filesystem.MODE_READ); // crash\r\n\r\nSTEPS TO REPRODUCE:\r\n1. Create the classic iOS titanium application.\r\n2. Replace the code in app.js with the code mentioned above.\r\n3. Add any file named as acceptance.js in its Resources folder.\r\n4. Build the application and launch it on device.\r\n\r\nEXPECTED RESULTs:\r\n4. The application should launch successfully on device.\r\n\r\nACTUAL RESULTS:\r\n4. The application crashes while launching with the below error.\r\n Please refer attachment as well.\r\n{code}\r\n[ERROR] : Script Error {\r\n[ERROR] : column = 20;\r\n[ERROR] : line = 12;\r\n[ERROR] : sourceURL = \"file:///private/var/mobile/Containers/Bundle/Application/5D52A62E-8359-43BA-8E22-CB95096B69CE/TIMOB-18078.app/app.js\";\r\n[ERROR] : stack = \"global code@file:///private/var/mobile/Containers/Bundle/Application/5D52A62E-8359-43BA-8E22-CB95096B69CE/TIMOB-18078.app/app.js:12:20\";\r\n[ERROR] : }\r\n{code}", "attachment": [ { "id": "52815", "filename": "Screen Shot 2014-11-25 at 6.27.30 PM.png", "author": { "name": "kagrawal", "key": "kagrawal", "displayName": "Khushbu Agrawal", "active": true, "timeZone": "Asia/Shanghai" }, "created": "2014-11-25T10:33:30.000+0000", "size": 68729, "mimeType": "image/png" } ], "flagged": false, "summary": "iOS: file.open(Ti.Filesystem.MODE_READ) crashes while opening the file object.", "creator": { "name": "kagrawal", "key": "kagrawal", "displayName": "Khushbu Agrawal", "active": true, "timeZone": "Asia/Shanghai" }, "subtasks": [], "reporter": { "name": "kagrawal", "key": "kagrawal", "displayName": "Khushbu Agrawal", "active": true, "timeZone": "Asia/Shanghai" }, "environment": "Tested on: \r\n1. Mac OSX Yosemite 10.10\r\n2. Appcelerator Studio, build: 3.4.1.201410281743\r\n3. Titanium SDK, build: 3.5.0.v20141124114114\r\n4. Titanium CLI, build: 3.4.1\r\n5. Alloy: 1.5.1\r\n6. Xcode 6.1\r\n7. iOS SDK 8.1\r\n8. iPhone 5s with iOS 8.1\r\n", "comment": { "comments": [ { "id": "333981", "author": { "name": "kagrawal", "key": "kagrawal", "displayName": "Khushbu Agrawal", "active": true, "timeZone": "Asia/Shanghai" }, "body": "The problem seems with passing .js file as argument to getFile() method. \r\nThe below code works fine.\r\n\r\nvar f = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, 'acceptance.txt');\r\nvar stream = f.open(Ti.Filesystem.MODE_READ); // crash", "updateAuthor": { "name": "kagrawal", "key": "kagrawal", "displayName": "Khushbu Agrawal", "active": true, "timeZone": "Asia/Shanghai" }, "created": "2014-11-27T03:35:21.000+0000", "updated": "2014-11-27T03:35:21.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }