{ "id": "121544", "key": "TIMOB-15641", "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": "2013-10-23T14:45:19.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "SupportTeam", "reprod" ], "versions": [ { "id": "15593", "description": "Release 3.1.3", "name": "Release 3.1.3", "archived": true, "released": true, "releaseDate": "2013-09-18" } ], "issuelinks": [], "assignee": null, "updated": "2018-02-28T20:03:18.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": "h4. Problem Description\r\nTI.Contacts.createGroup craches on device if exchange sync or facebook-sync of contacts is activated, without syncing to others it crashes NOT on createGroup but on adding a person to a group. Works fine on simulator (with sync-contacts to facebook, too)\r\nTi.Contacts.removeGroup don't work on Simulator and Device.\r\n\r\nh4. Steps to reproduce\r\n1. Create a new mobile Project\r\n2. Paste this code into app.js\r\n{code}\r\nvar self = Ti.UI.createWindow({backgroundColor:'white'});\r\n\r\n\t//label using localization-ready strings from /i18n/en/strings.xml\r\n\tvar label = Ti.UI.createButton({\r\n\t\tcolor : '#000000',\r\n\t\ttitle : \"hug me!\",\r\n\t\theight : 'auto',\r\n\t\twidth : 'auto'\r\n\t});\r\n\tself.add(label);\r\n\r\n\t//Add behavior for UI\r\n\tlabel.addEventListener('click', function(e) {\r\n\t\t\r\n\t\tvar getgroup = function(groupname){\r\n\t\t\tvar mygroup = Ti.Contacts.getAllGroups();\r\n\t\t\tfor (var i in mygroup){\r\n\t\t\t\tif (groupname == mygroup[i].name){\r\n\t\t\t\t\treturn mygroup[i];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t\t\r\n\t\tvar performAddressBookFunction = function() {\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\talert('creating group');\r\n\t\t\tTi.Contacts.createGroup({\r\n\t\t\t\tname : \"mygroup\"\r\n\t\t\t});\r\n\t\t\tTi.Contacts.save();\r\n\t\t\talert(\"Group saved - now adding person\");\r\n\t\t\tvar people = Ti.Contacts.getAllPeople();\r\n\t\t\talert('Saving contact...');\r\n\t\t\tvar myperson = Ti.Contacts.createPerson({\r\n\t\t\t\tfirstName : 'Paul',\r\n\t\t\t\tlastName : 'Dowsett',\r\n\t\t\t\taddress : {\r\n\t\t\t\t\twork : [{\r\n\t\t\t\t\t\tCountryCode : 'gb', // determines how the address is displayed\r\n\t\t\t\t\t\tStreet : '200 Brook Drive\\nGreen Park',\r\n\t\t\t\t\t\tCity : 'Reading',\r\n\t\t\t\t\t\tCounty : 'Berkshire',\r\n\t\t\t\t\t\tCountry : 'England',\r\n\t\t\t\t\t\tZIP : 'RG2 6UB'\r\n\t\t\t\t\t}, {\r\n\t\t\t\t\t\tCountryCode : 'gb', // determines how the address is displayed\r\n\t\t\t\t\t\tStreet : '1 St Pauls Road\\nClerkenwell',\r\n\t\t\t\t\t\tCity : 'City of London',\r\n\t\t\t\t\t\tState : 'London',\r\n\t\t\t\t\t\tCountry : 'England',\r\n\t\t\t\t\t\tZIP : 'EC1 1AA'\r\n\t\t\t\t\t}],\r\n\t\t\t\t\thome : [{\r\n\t\t\t\t\t\tCountryCode : 'gb', // determines how the address is displayed\r\n\t\t\t\t\t\tStreet : '2 Boleyn Court',\r\n\t\t\t\t\t\tCity : 'London',\r\n\t\t\t\t\t\tState : 'Greenwich',\r\n\t\t\t\t\t\tCountry : 'England',\r\n\t\t\t\t\t\tZIP : 'SE10'\r\n\t\t\t\t\t}]\r\n\t\t\t\t},\r\n\t\t\t\tbirthday : '2012-01-01T12:00:00.000+0000',\r\n\t\t\t\tinstantMessage : {\r\n\t\t\t\t\thome : [{\r\n\t\t\t\t\t\tservice : 'AIM',\r\n\t\t\t\t\t\tusername : 'leisureAIM'\r\n\t\t\t\t\t}, {\r\n\t\t\t\t\t\tservice : 'MSN',\r\n\t\t\t\t\t\tusername : 'no_paul_here@msn.com'\r\n\t\t\t\t\t}],\r\n\t\t\t\t\twork : [{\r\n\t\t\t\t\t\tservice : 'AIM',\r\n\t\t\t\t\t\tusername : 'seriousAIM'\r\n\t\t\t\t\t}]\r\n\t\t\t\t},\r\n\t\t\t\torganization : 'Appcelerator',\r\n\t\t\t\tphone : {\r\n\t\t\t\t\tmobile : ['07900 000001', '07900 000002'],\r\n\t\t\t\t\twork : ['+44 (0)118 925 6128', '+44 (0)118 000 0000']\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t});\r\n\t\t\talert(\"Person saved - now adding person: \"+myperson.fullName);\r\n\t\t\tvar group = getgroup(\"mygroup\");\r\n\t\t\tgroup.add(myperson);\r\n\t\t\tTi.Contacts.save();\r\n\t\t\t//return;\r\n\t\t\talert(\"Person added - now deleting group\");\r\n\t\t\tvar mygroup = Ti.Contacts.getAllGroups();\r\n\t\t\tvar group = getgroup(\"mygroup\");\r\n\t\t\talert(mygroup.length + \" Groups available - deleting 'mygroup'\");\r\n\t\t\tTi.Contacts.removeGroup(group);\r\n\t\t\tTi.Contacts.save();\r\n\t\t\tvar mygroup = Ti.Contacts.getAllGroups();\r\n\t\t\talert(mygroup.length + \" Groups available after deleting\");\r\n\t\t};\r\n\t\tvar addressBookDisallowed = function() {\r\n\t\t\talert(\"no access!\");\r\n\t\t};\r\n\t\tif (Ti.Contacts.contactsAuthorization == Ti.Contacts.AUTHORIZATION_AUTHORIZED) {\r\n\t\t\tperformAddressBookFunction();\r\n\t\t} else if (Ti.Contacts.contactsAuthorization == Ti.Contacts.AUTHORIZATION_UNKNOWN) {\r\n\t\t\tTi.Contacts.requestAuthorization(function(e) {\r\n\t\t\t\tif (e.success) {\r\n\t\t\t\t\tperformAddressBookFunction();\r\n\t\t\t\t} else {\r\n\t\t\t\t\taddressBookDisallowed();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\taddressBookDisallowed();\r\n\t\t}\r\n\t});\r\n\r\nself.open();\r\n{code}\r\n3. Run it into a device.\r\n4. The device will crash. ", "attachment": [ { "id": "43404", "filename": "ContactTest 2.zip", "author": { "name": "graetz", "key": "graetz", "displayName": "Andreas Graetz", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-10-23T14:47:04.000+0000", "size": 2158209, "mimeType": "application/zip" } ], "flagged": false, "summary": "iOS: TI.Contacts.createGroup craches on device / Ti.Contacts.removeGroup don't work ", "creator": { "name": "graetz", "key": "graetz", "displayName": "Andreas Graetz", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "graetz", "key": "graetz", "displayName": "Andreas Graetz", "active": true, "timeZone": "Europe/Berlin" }, "environment": "Device and Simulator iOS 6 and 7, Titanium SDK 3.1.3", "comment": { "comments": [ { "id": "276345", "author": { "name": "graetz", "key": "graetz", "displayName": "Andreas Graetz", "active": true, "timeZone": "Europe/Berlin" }, "body": "Sample project, just press the button.", "updateAuthor": { "name": "graetz", "key": "graetz", "displayName": "Andreas Graetz", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-10-23T14:47:04.000+0000", "updated": "2013-10-23T14:47:04.000+0000" }, { "id": "422522", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "I am able to reproduce this issue with the following environment;\r\niPhone 7 (10.2)\r\nStudio 4.9.0.201705302345\r\nTi SDK 6.1.1.v20170620103414\r\nAppc NPM 4.2.9\r\nAppc CLI 6.2.1\r\nTi CLI 5.0.13\r\nAlloy 1.9.11\r\nArrow 2.0.0\r\nXcode 8.2 (8C38)\r\nNode v4.8.2\r\nJava 1.8.0_131", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-06-21T22:22:53.000+0000", "updated": "2017-06-21T22:22:53.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }