{ "id": "92670", "key": "TIMOB-9362", "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": "2012-06-19T18:10:04.000+0000", "created": "2012-06-01T12:39:32.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "community", "core", "regression" ], "versions": [ { "id": "13272", "description": "Release 2.0.1", "name": "Release 2.0.1", "archived": true, "released": true, "releaseDate": "2012-04-16" } ], "issuelinks": [ { "id": "17613", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "92454", "key": "TIMOB-9363", "fields": { "summary": "Android: Application forced close after taking picture from camera or selecting picture from gallery on first load.", "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": "opiecyrus", "key": "opiecyrus", "displayName": "Opie Cyrus", "active": true, "timeZone": "America/Chicago" }, "updated": "2017-03-30T21:28:17.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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "There is a consistent crash when using the camera on Android:\r\n\r\n- Install your application (eg. kitchensink) by downloading the .apk (NOT by deploying to the Android device via Eclipse). \r\n\r\n- The first time you use the camera, after you've taken the picture, as soon as you hit \"Save\", the app will crash before your camera success callback is called\r\n\r\nOnce you restart the app the camera save function works fine - ie. the crash only occurs on first use of camera.\r\n\r\nTo isolate this I created the simplest possible app that only fires up the camera and takes a picture. The camera code is taken directly from KitchenSink. You can also replicate the bug using KitchenSink.\r\n\r\nThe app works fine when built using the 1.7.2 and 1.8.2 SDK, and crashes on first use when built with the 2.0.1 or 2.0.2 SDK.\r\n\r\nSo it seems somewhere between 1.8.2 and 2.0.1 the camera code for Android broke.", "attachment": [], "flagged": false, "summary": "Android: first use of camera crashes on SDK 2.0.1+ (works on 1.8.2-)", "creator": { "name": "darugar", "key": "darugar", "displayName": "Parand Darugar", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "darugar", "key": "darugar", "displayName": "Parand Darugar", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Titanium Studio 2.0.1.201204132053 on OS X, Android 2.2+, also tested on Android 4.0 (3 separate phones).", "comment": { "comments": [ { "id": "197835", "author": { "name": "fox1986", "key": "fox1986", "displayName": "Marcel Klapschus", "active": true, "timeZone": "Europe/Berlin" }, "body": "can confirm this on SDK 2.0.2 too. Tested on Samsung Galaxy S -> same behaviour.", "updateAuthor": { "name": "fox1986", "key": "fox1986", "displayName": "Marcel Klapschus", "active": true, "timeZone": "Europe/Berlin" }, "created": "2012-06-08T01:59:04.000+0000", "updated": "2012-06-08T01:59:04.000+0000" }, { "id": "198063", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "From the behavior described in the ticket, it's very similar to TIMOB-8514.", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-11T14:33:31.000+0000", "updated": "2012-06-11T14:33:31.000+0000" }, { "id": "198816", "author": { "name": "opiecyrus", "key": "opiecyrus", "displayName": "Opie Cyrus", "active": true, "timeZone": "America/Chicago" }, "body": "Unable to reproduce the failure against master. Ran the following app deployed via tistudio and also manually copied apk to device then installed via file manager which should be the same process as downloading the apk. Beyond the expected restart of app upon first launch, the behavior was correct through preview, capture to saving.\r\n\r\nIf error still persists and ticket is re-opened, please attached exact test case used to reproduce the error.\r\n\r\n{code}\r\nvar win = Titanium.UI.createWindow({backgroundColor: 'red'});\r\nTitanium.Media.showCamera({\r\n\r\n\tsuccess:function(event)\r\n\t{\r\n\t\tvar cropRect = event.cropRect;\r\n\t\tvar image = event.media;\r\n\r\n\t\tTi.API.debug('Our type was: '+event.mediaType);\r\n\t\tif(event.mediaType == Ti.Media.MEDIA_TYPE_PHOTO)\r\n\t\t{\r\n\t\t\tvar imageView = Ti.UI.createImageView({\r\n\t\t\t\twidth:win.width,\r\n\t\t\t\theight:win.height,\r\n\t\t\t\timage:event.media\r\n\t\t\t});\r\n\t\t\twin.add(imageView);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\talert(\"got the wrong type back =\"+event.mediaType);\r\n\t\t}\r\n\t},\r\n\tcancel:function()\r\n\t{\r\n\t},\r\n\terror:function(error)\r\n\t{\r\n\t\t// create alert\r\n\t\tvar a = Titanium.UI.createAlertDialog({title:'Camera'});\r\n\r\n\t\t// set message\r\n\t\tif (error.code == Titanium.Media.NO_CAMERA)\r\n\t\t{\r\n\t\t\ta.setMessage('Please run this test on device');\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\ta.setMessage('Unexpected error: ' + error.code);\r\n\t\t}\r\n\r\n\t\t// show alert\r\n\t\ta.show();\r\n\t},\r\n\tsaveToPhotoGallery:true,\r\n\tallowEditing:true,\r\n\tmediaTypes:[Ti.Media.MEDIA_TYPE_VIDEO,Ti.Media.MEDIA_TYPE_PHOTO]\r\n});\r\nwin.open();\r\n{code}\r\n", "updateAuthor": { "name": "opiecyrus", "key": "opiecyrus", "displayName": "Opie Cyrus", "active": true, "timeZone": "America/Chicago" }, "created": "2012-06-15T23:49:49.000+0000", "updated": "2012-06-15T23:49:49.000+0000" }, { "id": "198817", "author": { "name": "opiecyrus", "key": "opiecyrus", "displayName": "Opie Cyrus", "active": true, "timeZone": "America/Chicago" }, "body": "Should be noted that I tried the same test inside a heavy weight window with the same results.", "updateAuthor": { "name": "opiecyrus", "key": "opiecyrus", "displayName": "Opie Cyrus", "active": true, "timeZone": "America/Chicago" }, "created": "2012-06-15T23:59:01.000+0000", "updated": "2012-06-15T23:59:01.000+0000" }, { "id": "198819", "author": { "name": "darugar", "key": "darugar", "displayName": "Parand Darugar", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This is definitely reproducible, even with kitchen sink. There's even a comment on the question I asked in Q&A with someone else reporting the same issue: http://developer.appcelerator.com/question/137640/android-first-time-use-of-camera-crashes-2nd-time-onwards-works\r\n\r\nHere's the exact code the produces the problem:\r\n\r\n---------------\r\nvar window = Titanium.UI.currentWindow;\r\n\r\nfunction camera_receipt() {\r\n Titanium.API.info('############ showing camera');\r\n\r\n Titanium.Media.showCamera({\r\n success: function(event) {\r\n Ti.API.info('--- receipt.js: Camera SUCCESS');\r\n\r\n var cropRect = event.cropRect;\r\n var receipt_image = event.media;\r\n },\r\n\r\n cancel: function() {\r\n Ti.API.info('--- receipt.js: Camera CANCEL');\r\n window.close();\r\n },\r\n\r\n error:function(error) {\r\n Ti.API.info('--- receipt.js: Camera ERROR');\r\n\r\n var a = Titanium.UI.createAlertDialog({title:'Camera'});\r\n if (error.code == Titanium.Media.NO_CAMERA) {\r\n a.setMessage('Device does not have camera capabilities');\r\n } else {\r\n a.setMessage('Unexpected error: ' + error.code);\r\n }\r\n a.show();\r\n window.close();\r\n },\r\n allowImageEditing:false,\r\n saveToPhotoGallery: Ti.Platform.osname == \"iphone\"? false: true,\r\n mediaTypes:[Ti.Media.MEDIA_TYPE_PHOTO]\r\n });\r\n}\r\n\r\ncamera_receipt();\r\n\r\n---------------\r\n", "updateAuthor": { "name": "darugar", "key": "darugar", "displayName": "Parand Darugar", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-16T00:13:42.000+0000", "updated": "2012-06-16T00:13:42.000+0000" }, { "id": "198918", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "We need additional information:\r\n\r\n* Was this test performed against master (currently master@63645c4) ?\r\n* We need a list of tested devices. This could be either a 4.x or a device-specific issue.\r\n\r\nWhen this information is provided please reopen this ticket.", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-18T10:10:40.000+0000", "updated": "2012-06-18T10:10:40.000+0000" }, { "id": "199056", "author": { "name": "fox1986", "key": "fox1986", "displayName": "Marcel Klapschus", "active": true, "timeZone": "Europe/Berlin" }, "body": "I had this crash on a Samsung Galaxy S Plus (I-9001) with Android 2.3", "updateAuthor": { "name": "fox1986", "key": "fox1986", "displayName": "Marcel Klapschus", "active": true, "timeZone": "Europe/Berlin" }, "created": "2012-06-18T22:35:03.000+0000", "updated": "2012-06-18T22:35:03.000+0000" }, { "id": "199059", "author": { "name": "darugar", "key": "darugar", "displayName": "Parand Darugar", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Crashes on 4 separate phones. Mine is a Galaxy Vibrant running 2.2, the other three I don't have handy but I can find if needed.\r\n\r\nIt's crashed on every phone we've tried it on regardless of android version.", "updateAuthor": { "name": "darugar", "key": "darugar", "displayName": "Parand Darugar", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-18T22:57:14.000+0000", "updated": "2012-06-18T22:57:14.000+0000" }, { "id": "199060", "author": { "name": "darugar", "key": "darugar", "displayName": "Parand Darugar", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This was tested on 2.0.1 and 2.0.2 where it crashes, and on 1.7.2 and 1.8.2 where it does not crash.", "updateAuthor": { "name": "darugar", "key": "darugar", "displayName": "Parand Darugar", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-18T22:58:24.000+0000", "updated": "2012-06-18T22:58:24.000+0000" }, { "id": "199061", "author": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "body": "@Parand - Can you please test it quickly with 2.1.0 (master) build? We have not been able to reproduce this issue so it would help us narrow down the issue.", "updateAuthor": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-18T23:03:29.000+0000", "updated": "2012-06-18T23:03:29.000+0000" }, { "id": "199063", "author": { "name": "darugar", "key": "darugar", "displayName": "Parand Darugar", "active": true, "timeZone": "America/Los_Angeles" }, "body": "@Neeraj, happy to. I looked briefly at how to build appcelerator from source but didn't get far, is there a 2.1.0 build available somewhere I can try? This and one more issue are holding up releasing my app so I'm very motivated to help ;-)", "updateAuthor": { "name": "darugar", "key": "darugar", "displayName": "Parand Darugar", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-18T23:07:05.000+0000", "updated": "2012-06-18T23:07:05.000+0000" }, { "id": "199103", "author": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "body": "@Parand - http://builds.appcelerator.com.s3.amazonaws.com/index.html. Use \"master\" from the drop down.", "updateAuthor": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-19T09:00:10.000+0000", "updated": "2012-06-19T09:00:10.000+0000" }, { "id": "199232", "author": { "name": "darugar", "key": "darugar", "displayName": "Parand Darugar", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tried building with SDK version 2.1.0v20120619132308 and I'm happy to report the issue is no longer there - using the camera for the first time does not cause a crash. Looks like whatever the issue was has been resolved in the lastest code base. Thank you guys.", "updateAuthor": { "name": "darugar", "key": "darugar", "displayName": "Parand Darugar", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-19T16:00:33.000+0000", "updated": "2012-06-19T16:00:33.000+0000" }, { "id": "199284", "author": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Reported has confirmed that this issue cannot be reproduced with the latest 2.1.0 build.", "updateAuthor": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-19T18:10:04.000+0000", "updated": "2012-06-19T18:10:04.000+0000" }, { "id": "416394", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as I am unable to reproduce the issue using the following environment; \r\nPixel (7.1) \r\nMacOS 10.11.6 (15G31) \r\nStudio 4.8.1.201612050850 \r\nTi SDK 6.0.3 GA \r\nAppc NPM 4.2.8 \r\nAppc CLI 6.1.0 \r\nTi CLI 5.0.11 \r\nAlloy 1.9.5 \r\nArrow 1.10.1 \r\nXcode 8.2 (8C38) \r\nNode v4.6.0 \r\nJava 1.7.0_80", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-30T21:28:17.000+0000", "updated": "2017-03-30T21:28:17.000+0000" } ], "maxResults": 16, "total": 16, "startAt": 0 } } }