{ "id": "99410", "key": "TIMOB-17187", "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": "2012-08-19T19:13:50.000+0000", "priority": null, "labels": [ "android", "core", "crash", "exalture" ], "versions": [], "issuelinks": [], "assignee": null, "updated": "2018-02-28T20:03:35.000+0000", "status": { "description": "This issue was once resolved, but the resolution was deemed incorrect. From here issues are either marked assigned or resolved.", "name": "Reopened", "id": "4", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "From time to time (when I select a few photos from the picture gallery or just take a photo, the application is crashing. I'm looking for memory leaks but everything seems to be ok. The crash happens even before calling the success event.\r\n\r\nHere is a sample of the code:\r\n\r\n{code}\r\nfunction chooseAPhoto() {\r\nTitanium.Media.openPhotoGallery({\r\n\r\nsuccess : function(event) {\r\nif (event.mediaType == Ti.Media.MEDIA_TYPE_PHOTO) { addImage(event.media); }\r\n},\r\ncancel : function() {\r\n},\r\nerror : function(error) {\r\n},\r\nallowEditing : false,\r\nmediaTypes : [Ti.Media.MEDIA_TYPE_PHOTO]\r\n});\r\n}\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: Application crash randomly after selecting picture from gallery", "creator": { "name": "asztern", "key": "asztern", "displayName": "Ariel Sztern", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "asztern", "key": "asztern", "displayName": "Ariel Sztern", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Android 2.2, Titanium SDK 2.1.2.v20120816171609", "comment": { "comments": [ { "id": "215099", "author": { "name": "asztern", "key": "asztern", "displayName": "Ariel Sztern", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I've tried the photo gallery example several times using the KitchenSink and it's happening the same.\r\nThis is a random problem, you could select 20 images without a problem and just 3 to get the crash.\r\n\r\nRegards,\r\nAriel", "updateAuthor": { "name": "asztern", "key": "asztern", "displayName": "Ariel Sztern", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-19T20:43:24.000+0000", "updated": "2012-08-19T20:43:24.000+0000" }, { "id": "216406", "author": { "name": "asztern", "key": "asztern", "displayName": "Ariel Sztern", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi,\r\n\r\nI'm trying to deploy this by today.\r\nIs there any progress in fixing this bug?\r\n\r\nRegards,\r\nAriel", "updateAuthor": { "name": "asztern", "key": "asztern", "displayName": "Ariel Sztern", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-28T05:25:13.000+0000", "updated": "2012-08-28T05:25:13.000+0000" }, { "id": "217314", "author": { "name": "asztern", "key": "asztern", "displayName": "Ariel Sztern", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Is there any news regarding this issue? I wasn't able to deploy my app last week because of this bug.\r\n\r\nI really appreciate and support and feedback.\r\n\r\nRegards,\r\nAriel", "updateAuthor": { "name": "asztern", "key": "asztern", "displayName": "Ariel Sztern", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-09-02T20:29:04.000+0000", "updated": "2012-09-02T20:29:04.000+0000" }, { "id": "218359", "author": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hello,\r\n\r\nI am unable to reproduce the issue (tested your code). I tried on the emulator with Android 2.3.3 and SDK 2.1.2 GA and it never crashed.\r\n\r\nAre you trying the Emulator or a real device? Which versions of the OS did you try, only 2.2?\r\n\r\nThanks\r\n", "updateAuthor": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "created": "2012-09-11T06:42:58.000+0000", "updated": "2012-09-11T06:42:58.000+0000" }, { "id": "218418", "author": { "name": "asztern", "key": "asztern", "displayName": "Ariel Sztern", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I've tried this with 3 phones: a Samsung Galaxy S with Android 2.3.3 an HTC with 2.2, a Samsung Galaxy S3 with 4.0.3\r\nThis error also happens with the KitchenSink sample on the device (everything happens on the device).\r\nThe thing about this, is that you could select 20 pictures without any problem, and the 21 get crashed, or juist 3 pictures and the 4th you get crashed.\r\nThis is something random, \r\n\r\nThanks,\r\nAriel", "updateAuthor": { "name": "asztern", "key": "asztern", "displayName": "Ariel Sztern", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-09-11T12:39:42.000+0000", "updated": "2012-09-11T12:39:42.000+0000" }, { "id": "223370", "author": { "name": "asztern", "key": "asztern", "displayName": "Ariel Sztern", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Please, check this issue. Is still happening.\n\nThanks", "updateAuthor": { "name": "asztern", "key": "asztern", "displayName": "Ariel Sztern", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-10-13T03:49:12.000+0000", "updated": "2012-10-13T03:49:12.000+0000" }, { "id": "236182", "author": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hello,\n\nWe've still been unable to replicate the problem; did you still have issues using the latest SDK released?", "updateAuthor": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-01-28T14:13:38.000+0000", "updated": "2013-01-28T14:13:38.000+0000" }, { "id": "301182", "author": { "name": "adriano72", "key": "adriano72", "displayName": "Adriano Massi", "active": true, "timeZone": "Europe/Berlin" }, "body": "Same for me: Nothing inside the \"success:\" handler seems to be executed when it randomly crashes. (I also totally emptied the \"success\" handler from any instruction).\r\n\r\nMonitor log:\r\n\r\n04-17 00:28:07.963: V/StateManager(7312): startStateForResult class com.android.gallery3d.app.AlbumPage, 1\r\n04-17 00:28:07.983: D/ImmediateSync(7312): cancel sync all\r\n04-17 00:28:08.023: W/GLSUser(14221): GoogleAccountDataService.getToken()\r\n04-17 00:28:08.053: D/ImmediateSync(7312): sync album for **********************/5033619820827575297\r\n04-17 00:28:08.053: I/GLRootView(7312): layout content pane 1080x1701 (compensation 0)\r\n04-17 00:28:08.313: I/art(760): Heap trim of managed (duration=28.391614ms, advised=8MB) and native (duration=4.473438ms, advised=2MB) heaps. Managed heap utilization of 51%.\r\n04-17 00:28:08.973: D/PicasaAlbumSet(7312): sync result: -1811593058.5033619820827575297: 0\r\n04-17 00:28:08.973: D/AlbumPage(7312): onSyncDone: ******************** result=0\r\n04-17 00:28:09.193: D/ImmediateSync(7312): cancel sync -1811593058.5033619820827575297\r\n04-17 00:28:09.213: E/TiMedia(9769): (main) [6183,102968] OnResult called: -1\r\n04-17 00:28:09.213: W/GalleryProvider(7312): unsupported column: _data\r\n04-17 00:28:09.223: I/EsApplication(10324): Trimming memory (onTrimMemory 60)\r\n04-17 00:28:09.233: I/EsApplication(10324): Trimming memory (onTrimMemory 60)\r\n04-17 00:28:09.243: W/ManagedEGLContext(28714): doTerminate failed: EGL count is 2 but managed count is 1\r\n04-17 00:28:09.253: I/EsApplication(10324): Trimming memory (onTrimMemory 60)\r\n04-17 00:28:10.433: D/MobileDataStateTracker(760): default: setPolicyDataEnable(enabled=true)\r\n04-17 00:28:10.493: I/EsApplication(10324): Trimming memory (onTrimMemory 60)\r\n04-17 00:28:10.513: I/art(10324): Heap trim of managed (duration=2.109480ms, advised=252KB) and native (duration=1.356823ms, advised=136KB) heaps. Managed heap utilization of 64%.\r\n04-17 00:28:19.173: W/ActivityManager(760): Launch timeout has expired, giving up wake lock!\r\n\r\n\r\nI confirm it happens totally random: even selecting the same image that worked in a previous attempt. The devices goes black screen and become unresponsive\r\n\r\nDevice (not emulator): LG Google Nexus 5\r\n\r\nHope it will be fixed cause I can't release my project cause of this\r\n\r\n\r\nBest\r\n\r\nAdriano", "updateAuthor": { "name": "adriano72", "key": "adriano72", "displayName": "Adriano Massi", "active": true, "timeZone": "Europe/Berlin" }, "created": "2014-04-16T23:29:14.000+0000", "updated": "2014-04-16T23:31:59.000+0000" }, { "id": "308887", "author": { "name": "ryanbuening", "key": "ryanbuening", "displayName": "Ryan Buening", "active": true, "timeZone": "America/New_York" }, "body": "I also have this issue in my Alloy app. I'm running Titanium 3.2.3. I get this issue every time on my Nexus 4 device. The app doesn't crash every time, but it will occasionally hang and go black. It will then recover after a few seconds.\r\n\r\n{noformat}\r\n[ERROR] : TiMedia: (main) [9798,265278] OnResult called: -1\r\n[INFO] : 10:18:03: success ran\r\n[INFO] : I/dalvikvm-heap: Grow heap (frag case) to 46.837MB for 31961104-byte allocation\r\n[INFO] : Choreographer: Skipped 93 frames! The application may be doing too much work on its main thread.\r\n{noformat}\r\n\r\n{code:JavaScript}\r\nfunction selectPhoto(){\r\n\tTitanium.Media.openPhotoGallery({\r\n\t\tsuccess : function(event) {\r\n\t\t\tDTG.log(\"success ran\");\r\n\t\t\tif (event.mediaType == Ti.Media.MEDIA_TYPE_PHOTO) {\r\n\t\t\t\tvar submitPhotoWindow = Alloy.createController('submitPhoto', {\r\n\t\t\t\t\timage : event.media\r\n\t\t\t\t}).getView();\r\n\t\t\t\t\r\n\t\t\t\tsubmitPhotoWindow.open();\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n}\r\n{code}", "updateAuthor": { "name": "ryanbuening", "key": "ryanbuening", "displayName": "Ryan Buening", "active": true, "timeZone": "America/New_York" }, "created": "2014-06-13T14:23:45.000+0000", "updated": "2014-06-13T14:23:45.000+0000" }, { "id": "309570", "author": { "name": "ryanbuening", "key": "ryanbuening", "displayName": "Ryan Buening", "active": true, "timeZone": "America/New_York" }, "body": "Is there something I should be doing differently in my code above to prevent this issue? Let me know if I need to provide more details on my environment.", "updateAuthor": { "name": "ryanbuening", "key": "ryanbuening", "displayName": "Ryan Buening", "active": true, "timeZone": "America/New_York" }, "created": "2014-06-18T14:19:54.000+0000", "updated": "2014-06-18T14:19:54.000+0000" }, { "id": "310054", "author": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "body": "I have been able to reproduce this on a Nexus 4 running 4.2.\r\nTitanium SDK 3.2.3.GA\r\nCLI 3.2.3\r\n\r\nMarking this issue as a bug for further investigation. Thank you for sticking with this issue.\r\nWe will update you about it as soon as possible.", "updateAuthor": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-06-19T22:22:54.000+0000", "updated": "2014-06-19T22:22:54.000+0000" }, { "id": "310126", "author": { "name": "adriano72", "key": "adriano72", "displayName": "Adriano Massi", "active": true, "timeZone": "Europe/Berlin" }, "body": "Thank you!!!", "updateAuthor": { "name": "adriano72", "key": "adriano72", "displayName": "Adriano Massi", "active": true, "timeZone": "Europe/Berlin" }, "created": "2014-06-20T06:24:23.000+0000", "updated": "2014-06-20T06:24:23.000+0000" }, { "id": "310651", "author": { "name": "nayram", "key": "nayram", "displayName": "Nayram ", "active": true, "timeZone": "Etc/GMT" }, "body": "Hi I am also facing the same issue when I run my app on a NEXUS 4, android version 4.4.3. Titanium sdk version 3.2.1 GA. I will appreciate some help on this issue.\r\n", "updateAuthor": { "name": "nayram", "key": "nayram", "displayName": "Nayram ", "active": true, "timeZone": "Etc/GMT" }, "created": "2014-06-24T15:37:17.000+0000", "updated": "2014-06-24T15:37:17.000+0000" }, { "id": "312830", "author": { "name": "giokve", "key": "giokve", "displayName": "Giorgio Pagnoni", "active": true, "timeZone": "Europe/Berlin" }, "body": "It must be a Nexus thing, since it crashes on my Nexus 7 too because of that \"OnResult called: -1\".\r\nHope it will be fixed asap, or if you have a workaround please share it with us, thank you!", "updateAuthor": { "name": "giokve", "key": "giokve", "displayName": "Giorgio Pagnoni", "active": true, "timeZone": "Europe/Berlin" }, "created": "2014-07-08T15:41:02.000+0000", "updated": "2014-07-08T15:41:02.000+0000" }, { "id": "325473", "author": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "body": "The out of memory crashes can be avoided by scaling down the images before it is set to the imageview. Some of these devices may have high resolution camera and the image size may be too big to load in the memory. \r\nTo resize the image, do something like\r\nanImageView.image = e.media.imageAsResized(600,600);", "updateAuthor": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2014-09-24T18:25:50.000+0000", "updated": "2014-09-24T18:25:50.000+0000" }, { "id": "328425", "author": { "name": "dharmik", "key": "dharmik", "displayName": "Dharmik Patel", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Hi I am also facing the same issue in Ti. SDK : 3.4.0 :(", "updateAuthor": { "name": "dharmik", "key": "dharmik", "displayName": "Dharmik Patel", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2014-10-17T05:49:23.000+0000", "updated": "2014-10-17T05:49:23.000+0000" } ], "maxResults": 21, "total": 21, "startAt": 0 } } }