{ "id": "145328", "key": "TIMOB-18631", "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": { "id": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2015-03-12T22:12:41.000+0000", "created": "2015-03-03T00:19:13.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2016-02-12T19:15:49.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "AlertDIalog show() causes crash on Android but OK on iOS\r\n\r\nI have a demo app that i am creating and want to show() and AlertDialog on a button click to confirm the user's action.\r\n\r\nI am following the code example in the online docs and it works fine on iOS. On Android it will work once or twice and then on the 3rd or fourth time, it causes a fatal crash (logs attached).\r\n\r\nRicardo has the project and can help anyone in Mountain View.\r\n\r\nTEST ACCOUNT LOGIN:\r\nusername: a\r\npassword: 1234\r\n\r\nWhen I use the same code in a simpler Hello World app it works fine on iOS and Android.", "attachment": [ { "id": "54413", "filename": "addApproval_fixed.zip", "author": { "name": "lbrenman", "key": "lbrenman", "displayName": "Leor Brenman", "active": true, "timeZone": "America/Havana" }, "created": "2015-03-12T01:44:52.000+0000", "size": 2481, "mimeType": "application/zip" }, { "id": "54285", "filename": "logcat.rtf", "author": { "name": "lbrenman", "key": "lbrenman", "displayName": "Leor Brenman", "active": true, "timeZone": "America/Havana" }, "created": "2015-03-03T00:19:13.000+0000", "size": 24582, "mimeType": "text/rtf" } ], "flagged": false, "summary": "Android: AlertDialog.show() causes crash", "creator": { "name": "lbrenman", "key": "lbrenman", "displayName": "Leor Brenman", "active": true, "timeZone": "America/Havana" }, "subtasks": [], "reporter": { "name": "lbrenman", "key": "lbrenman", "displayName": "Leor Brenman", "active": true, "timeZone": "America/Havana" }, "environment": "3.5.0GA\r\nAny Android emulator or device", "closedSprints": [ { "id": 126, "state": "closed", "name": "2018 Sprint 05 SDK", "startDate": "2018-02-25T19:38:08.926Z", "endDate": "2018-03-11T18:38:00.000Z", "completeDate": "2018-03-11T22:06:01.520Z", "originBoardId": 100 } ], "comment": { "comments": [ { "id": "344880", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~ralcocer] Can we extract this out into a test case to attach to the ticket?", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-03-03T00:23:54.000+0000", "updated": "2015-03-03T00:23:54.000+0000" }, { "id": "344883", "author": { "name": "ralcocer", "key": "ralcocer", "displayName": "Ricardo Alcocer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Leor created a minimalist test case but it's not giving any errors. It appears to be a combination of factors, but the patterns [~lbrenman] is using are not really unusual. I suppose I could post the whole project for review, if [~lbrenman] is fine with that.", "updateAuthor": { "name": "ralcocer", "key": "ralcocer", "displayName": "Ricardo Alcocer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-03-03T00:30:35.000+0000", "updated": "2015-03-03T00:30:35.000+0000" }, { "id": "344887", "author": { "name": "lbrenman", "key": "lbrenman", "displayName": "Leor Brenman", "active": true, "timeZone": "America/Havana" }, "body": "I am fine with that :)", "updateAuthor": { "name": "lbrenman", "key": "lbrenman", "displayName": "Leor Brenman", "active": true, "timeZone": "America/Havana" }, "created": "2015-03-03T00:46:52.000+0000", "updated": "2015-03-03T00:46:52.000+0000" }, { "id": "344888", "author": { "name": "ralcocer", "key": "ralcocer", "displayName": "Ricardo Alcocer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The project has modules and whatnot, so it exceeds the size allowed by Jira, but can be downloaded from : http://sht.tl/iS9rrP . [~lbrenman] created a test user \"a\" with password \"1234\".", "updateAuthor": { "name": "ralcocer", "key": "ralcocer", "displayName": "Ricardo Alcocer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-03-03T00:58:25.000+0000", "updated": "2015-03-03T00:58:25.000+0000" }, { "id": "345749", "author": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "body": "I've looked at the code but not tested it yet. You are creating an AlertDialog in the XML and showing it later. The AlertDialog is not meant to be used like that, it's meant to be created, shown, and garbage collected. Try creating the alert in code and showing it as soon as it's created. Create one instance per \"show\" that you need. They're not meant to be recycled.", "updateAuthor": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-03-11T22:55:03.000+0000", "updated": "2015-03-11T22:55:03.000+0000" }, { "id": "345754", "author": { "name": "lbrenman", "key": "lbrenman", "displayName": "Leor Brenman", "active": true, "timeZone": "America/Havana" }, "body": "That will be great if this is the case and i will check this out. However, i copied this code directly from our API docs at:\r\n\r\nhttp://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.AlertDialog\r\n\r\nAre the docs wrong or did i misinterpret the docs?", "updateAuthor": { "name": "lbrenman", "key": "lbrenman", "displayName": "Leor Brenman", "active": true, "timeZone": "America/Havana" }, "created": "2015-03-11T23:35:32.000+0000", "updated": "2015-03-11T23:35:32.000+0000" }, { "id": "345788", "author": { "name": "lbrenman", "key": "lbrenman", "displayName": "Leor Brenman", "active": true, "timeZone": "America/Havana" }, "body": "Your suggestion worked!! Thanks.\r\n\r\nI think we need to convert this to a document JIRA because the documentation does not clearly explain this and implies that you can implement via XML and js.\r\n\r\nIf you agree can you convert this to a documentation bug or i can, but will defer to your advice.", "updateAuthor": { "name": "lbrenman", "key": "lbrenman", "displayName": "Leor Brenman", "active": true, "timeZone": "America/Havana" }, "created": "2015-03-12T01:41:32.000+0000", "updated": "2015-03-12T01:41:32.000+0000" }, { "id": "345789", "author": { "name": "lbrenman", "key": "lbrenman", "displayName": "Leor Brenman", "active": true, "timeZone": "America/Havana" }, "body": "Fixed controller with Pedro's suggested fix", "updateAuthor": { "name": "lbrenman", "key": "lbrenman", "displayName": "Leor Brenman", "active": true, "timeZone": "America/Havana" }, "created": "2015-03-12T01:44:52.000+0000", "updated": "2015-03-12T01:44:52.000+0000" }, { "id": "345884", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Unable to reproduce with this test case\r\n{code}\r\nvar win = Ti.UI.createWindow();\r\n var btn = Ti.UI.createButton({\r\n title:'click me now!'\r\n });\r\n win.add(btn);\r\n var myAlert = Ti.UI.createAlertDialog({\r\n title: 'alert',\r\n message: 'Alert',\r\n buttonNames: ['ok']\r\n });\r\n btn.addEventListener('click', function(){\r\n myAlert.show();\r\n });\r\n win.open();\r\n{code}", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-03-12T22:10:11.000+0000", "updated": "2015-03-12T22:10:11.000+0000" }, { "id": "345885", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I analyzed the log and there wasn't any log indicating a crashing error from Titanium that is app related. Since I can't reproduce this issue, I'll resolve it. Please feel free to reopen if you have more information, though it looks like your problem is solved.", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-03-12T22:12:13.000+0000", "updated": "2015-03-12T22:12:13.000+0000" }, { "id": "376760", "author": { "name": "abdielou", "key": "abdielou", "displayName": "Abdiel Aviles", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Pedro Enrique,\r\n\r\nI'm extremely confused here. Are we supposed to use it with XML or not? You state we are not supposed to, but as Leor Brenman says, the documentation even gives an example of how to use it with XML.\r\n\r\nLooks like I'm also getting this crash on devices with low memory.", "updateAuthor": { "name": "abdielou", "key": "abdielou", "displayName": "Abdiel Aviles", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-02-12T19:15:49.000+0000", "updated": "2016-02-12T19:15:49.000+0000" } ], "maxResults": 11, "total": 11, "startAt": 0 } } }