{ "id": "115903", "key": "TIMOB-14231", "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": "15564", "description": "2013 Sprint 15 API", "name": "2013 Sprint 15 API", "archived": true, "released": true, "releaseDate": "2013-07-29" }, { "id": "15567", "description": "2013 Sprint 15", "name": "2013 Sprint 15", "archived": true, "released": true, "releaseDate": "2013-07-29" }, { "id": "15479", "description": "Release 3.1.2", "name": "Release 3.1.2", "archived": true, "released": true, "releaseDate": "2013-07-31" }, { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-07-17T20:53:07.000+0000", "created": "2013-06-13T19:16:53.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "filesystem", "ios7", "qe-closed-3.1.2", "qe-testadded" ], "versions": [], "issuelinks": [ { "id": "30308", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "116309", "key": "TIMOB-14340", "fields": { "summary": "iOS7: Localhost prefix from file:// path has been removed", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "29589", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "115799", "key": "TIMOB-14182", "fields": { "summary": "iOS7: Update SDK to support building/running apps for iOS 7", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "6", "description": "gh.issue.epic.desc", "name": "Epic", "subtask": false } } } }, { "id": "31925", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "120041", "key": "TIMOB-15243", "fields": { "summary": "iOS7: Saving file to applicationDataDirectory results in incorrect path", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2015-06-12T15:55:13.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "*Problem*\r\nI often have JSON-files with configuration for my app. I noticed in iOS 7 that my apps won't even start, because it won't read my JSON-files. It seems like it can't find anything in the Resources-directory (I haven't tried other directories yet).\r\n\r\n*Test-case*\r\n1. Create a project with the files below\r\n2. Ignore my variable names\r\n3. Run the app, click on the button\r\n\r\n*Expected result*\r\nIt should print a bunch of names in the console.\r\n\r\n*Actual result*\r\nI get the \"meow.json is missing\" error.\r\n\r\n*app.js*\r\n{code:javascript}Titanium.UI.setBackgroundColor('#000');\r\n\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: \"#fff\"\r\n});\r\n\r\nvar button = Ti.UI.createButton({\r\n title: \"INSTALL CATS\",\r\n height: '50dp',\r\n width: '140dp'\r\n});\r\n\r\nwin.add(button);\r\n\r\nwin.open();\r\n\r\nbutton.addEventListener('click', function() {\r\n\r\n var allTheCats = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, 'meow.json');\r\n\r\n if (!allTheCats.exists()) {\r\n\r\n Ti.API.error(\"meow.json is missing\");\r\n\r\n } else {\r\n\r\n allTheCats = JSON.parse(allTheCats.read().text);\r\n\r\n allTheCats.forEach(function(cat) {\r\n\r\n var test = Ti.Contacts.getPeopleWithName(cat.firstName);\r\n Ti.API.info(JSON.stringify(test));\r\n\r\n });\r\n\r\n }\r\n\r\n});{code}\r\n\r\n*meow.json*\r\n{code:json}[\r\n {\r\n \"firstName\": \"Reno\"\r\n },\r\n {\r\n \"firstName\": \"Sonny\"\r\n },\r\n {\r\n \"firstName\": \"Vincent\"\r\n }\r\n]{code}", "attachment": [], "flagged": false, "summary": "iOS7: Can't read a file from the Resources folder", "creator": { "name": "arood", "key": "arood", "displayName": "Marcus Olovsson", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "arood", "key": "arood", "displayName": "Marcus Olovsson", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "comment": { "comments": [ { "id": "257824", "author": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "body": "Maybe fixed with this PR -- https://github.com/appcelerator/titanium_mobile/pull/4393 -- I was seeing something very similar. You might give it a go and see if it works for you too, Marcus.", "updateAuthor": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "created": "2013-06-14T04:19:23.000+0000", "updated": "2013-06-14T04:19:23.000+0000" }, { "id": "257841", "author": { "name": "arood", "key": "arood", "displayName": "Marcus Olovsson", "active": true, "timeZone": "Europe/Berlin" }, "body": "Dawson Toth: Tried adding your fix but sadly it didn't seem to help. I added .getNativePath() and .resolve() to see which paths it is using, if that helps:\n\n{code}[ERROR] file:///Users/arood/Library/Application%20Support/iPhone%20Simulator/7.0/Applications/5F7E931D-94E1-4733-BC6C-86B9801EA0C8/Katter.app/file:/Users/arood/Library/Application%2520Support/iPhone%2520Simulator/7.0/Applications/5F7E931D-94E1-4733-BC6C-86B9801EA0C8/Katter.app/meow.json\n[ERROR] /Users/arood/Library/Application Support/iPhone Simulator/7.0/Applications/5F7E931D-94E1-4733-BC6C-86B9801EA0C8/Katter.app/file:/Users/arood/Library/Application%20Support/iPhone%20Simulator/7.0/Applications/5F7E931D-94E1-4733-BC6C-86B9801EA0C8/Katter.app/meow.json{code}", "updateAuthor": { "name": "arood", "key": "arood", "displayName": "Marcus Olovsson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-06-14T06:42:46.000+0000", "updated": "2013-06-14T06:42:46.000+0000" }, { "id": "257882", "author": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "body": "That's an identical path to what I was seeing. Try again, it's possible you didn't apply the change properly.", "updateAuthor": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "created": "2013-06-14T15:54:10.000+0000", "updated": "2013-06-14T15:54:10.000+0000" }, { "id": "257885", "author": { "name": "arood", "key": "arood", "displayName": "Marcus Olovsson", "active": true, "timeZone": "Europe/Berlin" }, "body": "Ah yes, thought it would be enough to change the class-files in the build-folder. Tried applying it to the SDK-folder itself and that seems to have worked! Thanks!", "updateAuthor": { "name": "arood", "key": "arood", "displayName": "Marcus Olovsson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-06-14T15:59:27.000+0000", "updated": "2013-06-14T15:59:27.000+0000" }, { "id": "257889", "author": { "name": "clathrop", "key": "clathrop", "displayName": "Carter Lathrop", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Moved issue to Ti-Mobile, linked to new iOS7 support page. Request to implement pull request from Dawson for the fix.", "updateAuthor": { "name": "clathrop", "key": "clathrop", "displayName": "Carter Lathrop", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-06-14T16:18:19.000+0000", "updated": "2013-06-14T16:18:19.000+0000" }, { "id": "264054", "author": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "body": "To QE:\r\nPlease add contacts to your device or simulator before testing .\r\n\r\nTest code:\r\n\r\napp.js\r\n{code}\r\nTitanium.UI.setBackgroundColor('#000');\r\n \r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: \"#fff\"\r\n});\r\n \r\nvar button = Ti.UI.createButton({\r\n title: \"INSTALL CATS\",\r\n height: '50dp',\r\n width: '140dp'\r\n});\r\n \r\nwin.add(button);\r\n \r\nwin.open();\r\n\r\nbutton.addEventListener('click', function() {\r\n\tif (Ti.Contacts.contactsAuthorization == Ti.Contacts.AUTHORIZATION_AUTHORIZED){\r\n\t\tperformAddressBookFunction();\r\n\t} else if (Ti.Contacts.contactsAuthorization == Ti.Contacts.AUTHORIZATION_UNKNOWN){\r\n\t Ti.Contacts.requestAuthorization(function(e){\r\n\t if (e.success) {\r\n\t performAddressBookFunction();\r\n\t } else {\r\n\t addressBookDisallowed();\r\n\t }\r\n\t });\r\n\t} else {\r\n\t addressBookDisallowed();\r\n\t}\r\n\t\r\n});\r\n\r\nfunction performAddressBookFunction() {\r\n var allTheCats = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, 'meow.json');\r\n \r\n if (!allTheCats.exists()) {\r\n \r\n Ti.API.error(\"meow.json is missing\");\r\n \r\n } else {\r\n \r\n allTheCats = JSON.parse(allTheCats.read().text);\r\n \t\r\n \tallTheCats.forEach(function(cat) {\r\n\tTi.API.info(\"A cat is named: \"+cat.firstName);\r\n\t\r\n var test = Ti.Contacts.getPeopleWithName(cat.firstName);\r\n \r\n });\r\n \r\n };\r\n};\r\n\r\nfunction addressBookDisallowed() {\r\n\talert(\"You are not allowed to access contacts\");\r\n};\r\n\r\n{code}\r\n\r\nmeow.json\r\n{code}\r\n[\r\n {\r\n \"firstName\": \"Reno\"\r\n },\r\n {\r\n \"firstName\": \"Sonny\"\r\n },\r\n {\r\n \"firstName\": \"Vincent\"\r\n }\r\n]\r\n{code}\r\n\r\nTested and verified fix with:\r\nAppcelerator Studio, build: 3.1.2.201307261628\r\nXcode5-DP4\r\niPhone5 iOS7\r\niPad 4 iOS7", "updateAuthor": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-07-30T23:56:16.000+0000", "updated": "2013-07-30T23:56:46.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }