{ "id": "65854", "key": "TIMOB-4235", "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": "11355", "description": "Mobile 1.8.0 M02", "name": "Sprint 2011-23", "archived": true, "released": true, "releaseDate": "2011-06-13" } ], "resolution": { "id": "8", "description": "", "name": "Needs more info" }, "resolutiondate": "2011-06-09T08:33:45.000+0000", "created": "2011-05-27T13:59:27.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "andoid" ], "versions": [ { "id": "11260", "description": "", "name": "Release 1.6.2", "archived": true, "released": true, "releaseDate": "2011-04-20" } ], "issuelinks": [ { "id": "39265", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "133516", "key": "AC-1631", "fields": { "summary": "Android: Titanium.Media.showCamera crashes for large images on load of ti.paint module", "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" } }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-22T22:31:53.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": "Taking a picture crashes app on Sony Xperia X10.\r\nCan be reproduced reliably with Kitchen Sink, by executing \"Phone -> Camera -> Camera Basic\" and taking a picture.\r\nThe example below causes the same error. Only crashes on \"Sony Xperia X10\".\r\n\r\nStep 1: run the code below\r\nStep 2: take a picture\r\nStep 3: notice the app crash\r\n\r\n{code:title=app.js}\r\nvar win = Ti.UI.createWindow({ fullscreen: true });\r\n\r\nvar cameraOverlay = Ti.UI.createView();\r\nvar cameraButton = Ti.UI.createButton({\r\n\ttitle:\"Take Picture\",\r\n\tbottom: 10\r\n});\r\ncameraButton.addEventListener('click', function(e){\r\n\tTi.Media.takePicture();\r\n});\r\ncameraOverlay.add(cameraButton);\r\n\r\nvar open = Ti.UI.createButton({\r\n\ttitle: 'Open',\r\n\tbottom: 100,\r\n\theight: 40,\r\n\twidth: 200\r\n});\r\nopen.addEventListener('click', function(){\r\n\tTitanium.Media.showCamera({\r\n\r\n\t\tsuccess:function(event)\r\n\t\t{\r\n\t\t\tvar cropRect = event.cropRect;\r\n\t\t\tvar image = event.media;\r\n\r\n\t\t\tTi.API.debug('Our type was: '+event.mediaType);\r\n\t\t\tif(event.mediaType == Ti.Media.MEDIA_TYPE_PHOTO)\r\n\t\t\t{\r\n\t\t\t\tvar imageView = Ti.UI.createImageView({\r\n\t\t\t\t\twidth:win.width,\r\n\t\t\t\t\theight:win.height,\r\n\t\t\t\t\timage:event.media\r\n\t\t\t\t});\r\n\t\t\t\twin.add(imageView);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\talert(\"got the wrong type back =\"+event.mediaType);\r\n\t\t\t}\r\n\t\t},\r\n\t\tcancel:function()\r\n\t\t{\r\n\t\t},\r\n\t\terror:function(error)\r\n\t\t{\r\n\t\t\t// create alert\r\n\t\t\tvar a = Titanium.UI.createAlertDialog({title:'Camera'});\r\n\r\n\t\t\t// set message\r\n\t\t\tif (error.code == Titanium.Media.NO_CAMERA)\r\n\t\t\t{\r\n\t\t\t\ta.setMessage('Please run this test on device');\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\ta.setMessage('Unexpected error: ' + error.code);\r\n\t\t\t}\r\n\r\n\t\t\t// show alert\r\n\t\t\ta.show();\r\n\t\t},\r\n\t\tsaveToPhotoGallery:true,\r\n\t\tallowEditing:true,\r\n\t\tmediaTypes:[Ti.Media.MEDIA_TYPE_VIDEO,Ti.Media.MEDIA_TYPE_PHOTO],\r\n\t\t// overlay: cameraOverlay\r\n\t});\r\n});\r\n\r\nwin.add(open);\r\nwin.open();\r\n{code}\r\n\r\nh3. Stack Trace:\r\n\r\n java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1, result=-1, data=Intent { act=inline-data dat=file:///sdcard/dcim/Camera/Memonic/tia608277175.jpg typ=image/jpeg (has extras) }} to activity {com.memonic.mobile/org.appcelerator.titanium.TiModalActivity}: java.lang.NullPointerException\r\n at android.app.ActivityThread.deliverResults(ActivityThread.java:2504)\r\n at android.app.ActivityThread.handleSendResult(ActivityThread.java:2546)\r\n at android.app.ActivityThread.access$2000(ActivityThread.java:121)\r\n at android.app.ActivityThread$H.handleMessage(ActivityThread.java:966)\r\n at android.os.Handler.dispatchMessage(Handler.java:99)\r\n at android.os.Looper.loop(Looper.java:123)\r\n at android.app.ActivityThread.main(ActivityThread.java:3652)\r\n at java.lang.reflect.Method.invokeNative(Native Method)\r\n at java.lang.reflect.Method.invoke(Method.java:507)\r\n at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:862)\r\n at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)\r\n at dalvik.system.NativeStart.main(Native Method)\r\n Caused by: java.lang.NullPointerException\r\n at java.io.File.fixSlashes(File.java:205)\r\n at java.io.File.init(File.java:189)\r\n at java.io.File.(File.java:139)\r\n at ti.modules.titanium.media.MediaModule$CameraResultHandler.onResult(MediaModule.java:318)\r\n at org.appcelerator.titanium.util.TiActivitySupportHelper$1.onResult(TiActivitySupportHelper.java:52)\r\n at org.appcelerator.titanium.util.TiActivitySupportHelper.onActivityResult(TiActivitySupportHelper.java:68)\r\n at org.appcelerator.titanium.TiBaseActivity.onActivityResult(TiBaseActivity.java:354)\r\n at android.app.Activity.dispatchActivityResult(Activity.java:3907)\r\n at android.app.ActivityThread.deliverResults(ActivityThread.java:2500)\r\n ... 11 more\r\n\r\nh3. Workaround\r\nUse an overlay. In the example above, uncomment \"// overlay: cameraOverlay\" and the camera will work as expected.\r\n\r\nh3. Associated Helpdesk Ticket\r\nhttp://appc.me/c/APP-791753\r\n", "attachment": [ { "id": "21447", "filename": "Screen shot 2011-06-23 at 12.08.09 PM.png", "author": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-06-23T12:18:31.000+0000", "size": 120831, "mimeType": "image/png" } ], "flagged": false, "summary": "Android: taking a picture crashes app on Sony Xperia X10", "creator": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Sony Xperia X10 mini, Android 2.2, TiSDK 1.6.2\r\nSony Xperia X10, Android 2.2, TiSDK 1.6.2", "comment": { "comments": [ { "id": "134651", "author": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Try and reproduce on the Play. If we can't we may have to get the X10.", "updateAuthor": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-06-01T12:00:18.000+0000", "updated": "2011-06-01T12:00:18.000+0000" }, { "id": "274907", "author": { "name": "ygbr", "key": "ygbr", "displayName": "Ygor Lemos", "active": true, "timeZone": "America/Sao_Paulo" }, "updateAuthor": { "name": "ygbr", "key": "ygbr", "displayName": "Ygor Lemos", "active": true, "timeZone": "America/Sao_Paulo" }, "created": "2013-10-12T18:16:41.000+0000", "updated": "2013-10-12T18:16:41.000+0000" }, { "id": "415137", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket due to the information that was requested not being provided.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-22T22:31:53.000+0000", "updated": "2017-03-22T22:31:53.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }