{ "id": "169745", "key": "TIMOB-25265", "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": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-08-30T02:44:04.000+0000", "created": "2017-09-11T13:44:44.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [], "versions": [], "issuelinks": [], "assignee": null, "updated": "2018-08-30T02:44:04.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": " app freezes and crashes without errors when using openPhotoGallery and selecting images with small cloud icon.\r\nThose images are part of the device storage and not yet back up.\r\nWhen pressing on images with no backup cloud icon it works well and i get to the success callback event\r\n 6.1.2.GA\r\nBelow used function.\r\nvar buttonGallery = Titanium.UI.createButton({\r\n title:\"Open the photo gallery\",\r\n width:180,\r\n height:48,\r\n bottom: 12,\r\n zIndex:2\r\n}); \r\n\r\n\r\nbuttonGallery.addEventListener(\"click\", function(e){\r\n\r\n\r\n //obtain an image from the gallery\r\n Titanium.Media.openPhotoGallery({\r\n success:function(event)\r\n {\r\nalert('1');\r\n\t },\r\n\t error:function(error)\r\n\t\t {\r\n\r\n\t\t //set message\r\n\t\t if (error.code == Titanium.Media.NO_CAMERA)\r\n\t\t {\r\n\t\t alert('No Cam');\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t alert('error');\r\n\t\t }\r\n\t\t\r\n\t\t },\r\n\t cancel:function()\r\n\t {\r\n\t //user cancelled the action fron within\r\n\t //the photo gallery\r\n\t }\r\n\t });\r\n\t});", "attachment": [], "flagged": false, "summary": "Android: OpenPhotoGallery crash when i try to select images with small cloud icon(not backup)", "creator": { "name": "boaz@e-drivetech.com", "key": "boaz@e-drivetech.com", "displayName": "boaz@e-drivetech.com", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "boaz@e-drivetech.com", "key": "boaz@e-drivetech.com", "displayName": "boaz@e-drivetech.com", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "427789", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hey there, is this iOS or Android? Please always indicate the platform and complete environment (CLI-version, SDK-version, platform, platform version). \r\n\r\nAlso, any idea how to test this? Connect with iCloud and try to access it before it's synced? I feel, if it's an iOS issue, it's rather an edge-case on iOS that is not handled properly, since it shouldn't even show up in the media-picker then.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-09-12T06:30:15.000+0000", "updated": "2017-09-12T13:05:20.000+0000" }, { "id": "427820", "author": { "name": "boaz@e-drivetech.com", "key": "boaz@e-drivetech.com", "displayName": "boaz@e-drivetech.com", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Android\nSamsung 7 edge\nLatest cli and sdk 6.2.2", "updateAuthor": { "name": "boaz@e-drivetech.com", "key": "boaz@e-drivetech.com", "displayName": "boaz@e-drivetech.com", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-09-13T02:52:57.000+0000", "updated": "2017-09-13T02:52:57.000+0000" }, { "id": "427844", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~boaz@e-drivetech.com], can you tell us which photo gallery app was opened please?\r\n\r\nThat is, did it look like Google's standard gallery app? Or a custom one from Samsung? Or did you do a photo selection from another app such as GoogleDrive, DropBox, OneDrive, etc.?\r\n(I ask because photo selection can default to 3rd party apps.)\r\n\r\nAlso, if you can provide us the logged Android error messages, then that might help us isolate the issue. Thanks!", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-09-13T16:20:00.000+0000", "updated": "2017-09-13T16:20:00.000+0000" }, { "id": "435006", "author": { "name": "jonesdhtx", "key": "jonesdhtx", "displayName": "David Jones", "active": true, "timeZone": "America/Chicago" }, "body": "We are experiencing this issue as well:\r\nAndroid 7.0\r\nSDK: 7.0.2.GA\r\n\r\nWhen we call Ti.Media.openPhotoGallery, it opens up the Gallery of \"Recent\" photos and auto-slides out the menu drawer to let us select between \"Downloads\", \"Phone\", \"Google Drive\", \"Dropbox\", etc... \r\n\r\nWhen we select the \"Dropbox\" option, it opens dropbox, we select the desired file, and dropbox displays a \"downloading\" ux. Shortly after downloading (presumably when resuming our app with the selected image result) we get the following crash w/ stack trace:\r\n\r\n{code:java}\r\n[ERROR] CursorWindow: Failed to read row 0, column 1 from a CursorWindow which has 1 rows, 1 columns.\r\n[WARN] SystemReader: Cannot find supportKddiAuNaming, use default value instead\r\n[ERROR] TiApplication: (main) [45861,105353] Sending event: exception on thread: main msg:java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1, result=-1, data=Intent { dat=content: typ=image/png flg=0x3 }} to activity {com.example/org.appcelerator.titanium.TiActivity}: java.lang.IllegalStateException: Couldn't read row 0, col 1 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it.; Titanium 7.0.2,2018/02/09 10:59,undefined\r\n[ERROR] TiApplication: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1, result=-1, data=Intent { dat=content: typ=image/png flg=0x3 }} to activity {com.example/org.appcelerator.titanium.TiActivity}: java.lang.IllegalStateException: Couldn't read row 0, col 1 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it.\r\n[ERROR] TiApplication: at android.app.ActivityThread.deliverResults(ActivityThread.java:4297)\r\n[ERROR] TiApplication: at android.app.ActivityThread.handleSendResult(ActivityThread.java:4347)\r\n[ERROR] TiApplication: at android.app.ActivityThread.-wrap20(ActivityThread.java)\r\n[ERROR] TiApplication: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1557)\r\n[ERROR] TiApplication: at android.os.Handler.dispatchMessage(Handler.java:102)\r\n[ERROR] TiApplication: at android.os.Looper.loop(Looper.java:173)\r\n[ERROR] TiApplication: at android.app.ActivityThread.main(ActivityThread.java:6459)\r\n[ERROR] TiApplication: at java.lang.reflect.Method.invoke(Native Method)\r\n[ERROR] TiApplication: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:938)\r\n[ERROR] TiApplication: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:828)\r\n[ERROR] TiApplication: Caused by: java.lang.IllegalStateException: Couldn't read row 0, col 1 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it.\r\n[ERROR] TiApplication: at android.database.CursorWindow.nativeGetString(Native Method)\r\n[ERROR] TiApplication: at android.database.CursorWindow.getString(CursorWindow.java:460)\r\n[ERROR] TiApplication: at android.database.AbstractWindowedCursor.getString(AbstractWindowedCursor.java:51)\r\n[ERROR] TiApplication: at android.database.CursorWrapper.getString(CursorWrapper.java:142)\r\n[ERROR] TiApplication: at org.appcelerator.titanium.io.TitaniumBlob.init(TitaniumBlob.java:86)\r\n[ERROR] TiApplication: at org.appcelerator.titanium.io.TitaniumBlob.(TitaniumBlob.java:33)\r\n[ERROR] TiApplication: at org.appcelerator.titanium.io.TiFileFactory.createTitaniumFile(TiFileFactory.java:85)\r\n[ERROR] TiApplication: at ti.modules.titanium.media.MediaModule.createImageData(MediaModule.java:1061)\r\n[ERROR] TiApplication: at ti.modules.titanium.media.MediaModule.createDictForImage(MediaModule.java:1055)\r\n[ERROR] TiApplication: at ti.modules.titanium.media.MediaModule$1.onResult(MediaModule.java:1009)\r\n[ERROR] TiApplication: at org.appcelerator.titanium.util.TiActivitySupportHelper$1.onResult(TiActivitySupportHelper.java:60)\r\n[ERROR] TiApplication: at org.appcelerator.titanium.util.TiActivitySupportHelper.onActivityResult(TiActivitySupportHelper.java:113)\r\n[ERROR] TiApplication: at org.appcelerator.titanium.TiBaseActivity.onActivityResult(TiBaseActivity.java:793)\r\n[ERROR] TiApplication: at android.app.Activity.dispatchActivityResult(Activity.java:6926)\r\n[ERROR] TiApplication: at android.app.ActivityThread.deliverResults(ActivityThread.java:4293)\r\n[ERROR] TiApplication: ... 9 more\r\n{code}", "updateAuthor": { "name": "jonesdhtx", "key": "jonesdhtx", "displayName": "David Jones", "active": true, "timeZone": "America/Chicago" }, "created": "2018-02-28T16:36:03.000+0000", "updated": "2018-02-28T16:37:50.000+0000" }, { "id": "435106", "author": { "name": "jonesdhtx", "key": "jonesdhtx", "displayName": "David Jones", "active": true, "timeZone": "America/Chicago" }, "body": "More Info:\r\nI tried an alternative approach as a possible workaround but also ran into a similiar issue.\r\n\r\nThe general idea for this workaround was to:\r\n1) Launch an intent directly with the ACTION_GET_CONTENT action to pick an image (ultimately from dropbox)\r\n2) Upon success, we get a uri from dropbox contained in e.intent.data like:\r\n content://com.dropbox.android.FileCache/filecache/441c518d-c217-466b-8f6c-541d1b831f9a\r\n (this file had just been selected in dropbox ux and downloaded to device)\r\n3) Copy the content to a file in our app temp directory using Ti.Filesystem.getFile and copy() to effectively resolve the content uri and make a copy for us in our temp folder that we can access normally to get the image\r\n\r\nCODE:\r\n{code:javascript}\r\nvar intent = Titanium.Android.createIntent({\r\n action : Ti.Android.ACTION_GET_CONTENT,\r\n type : \"image/*\"\r\n});\r\n\r\nintent.addCategory(Ti.Android.CATEGORY_DEFAULT);\r\nTi.Android.currentActivity.startActivityForResult(intent, function(e) {\r\n if(e.intent && e.intent.data) {\r\n //Make a copy of the file into our app temp dir to automatically resolve any \"content://\" uri path\r\n var imageSourceFile = Ti.Filesystem.getFile(e.intent.data);\r\n var imageCopyFile = Ti.Filesystem.getFile(Ti.Filesystem.tempDirectory, imageSourceFile.name);\r\n imageSourceFile.copy(imageCopyFile.nativePath);\r\n var imageBlob = imageCopyFile.read();\r\n\r\n //Release file handles\r\n imageSourceFile = null;\r\n imageCopyFile = null;\r\n\r\n return onMediaSuccess({\r\n media: imageBlob\r\n });\r\n }\r\n});\r\n{code}\r\n\r\nHowever we encountered a similiar exception when we called \r\n{code:javascript}\r\n var imageSourceFile = Ti.Filesystem.getFile(e.intent.data);\r\n //e.intent.data is 'content://com.dropbox.android.FileCache/filecache/441c518d-c217-466b-8f6c-541d1b831f9a'\r\n{code}\r\n\r\nHere is the exception:\r\n{noformat}\r\n[ERROR] CursorWindow: Failed to read row 0, column 1 from a CursorWindow which has 1 rows, 1 columns.\r\n[WARN] W/System.err: java.lang.IllegalStateException: Couldn't read row 0, col 1 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it.\r\n[WARN] W/System.err: at android.database.CursorWindow.nativeGetString(Native Method)\r\n[WARN] W/System.err: at android.database.CursorWindow.getString(CursorWindow.java:460)\r\n[WARN] W/System.err: at android.database.AbstractWindowedCursor.getString(AbstractWindowedCursor.java:51)\r\n[WARN] W/System.err: at android.database.CursorWrapper.getString(CursorWrapper.java:142)\r\n[WARN] W/System.err: at org.appcelerator.titanium.io.TitaniumBlob.init(TitaniumBlob.java:86)\r\n[WARN] W/System.err: at org.appcelerator.titanium.io.TitaniumBlob.(TitaniumBlob.java:33)\r\n[WARN] W/System.err: at org.appcelerator.titanium.io.TiFileFactory.createTitaniumFile(TiFileFactory.java:85)\r\n[WARN] W/System.err: at org.appcelerator.titanium.util.TiUrl.resolve(TiUrl.java:258)\r\n[WARN] W/System.err: at org.appcelerator.kroll.KrollProxy.resolveUrl(KrollProxy.java:1321)\r\n[WARN] W/System.err: at org.appcelerator.titanium.TiFileProxy.(TiFileProxy.java:80)\r\n[WARN] W/System.err: at ti.modules.titanium.filesystem.FileProxy.(FileProxy.java:18)\r\n[WARN] W/System.err: at ti.modules.titanium.filesystem.FilesystemModule.getFile(FilesystemModule.java:85)\r\n[WARN] W/System.err: at org.appcelerator.kroll.runtime.v8.V8Function.nativeInvoke(Native Method)\r\n[WARN] W/System.err: at org.appcelerator.kroll.runtime.v8.V8Function.callSync(V8Function.java:57)\r\n[WARN] W/System.err: at org.appcelerator.kroll.runtime.v8.V8Function.call(V8Function.java:43)\r\n[WARN] W/System.err: at org.appcelerator.kroll.runtime.v8.V8Function$1.run(V8Function.java:70)\r\n[WARN] W/System.err: at android.os.Handler.handleCallback(Handler.java:751)\r\n[WARN] W/System.err: at android.os.Handler.dispatchMessage(Handler.java:95)\r\n[WARN] W/System.err: at android.os.Looper.loop(Looper.java:173)\r\n[WARN] W/System.err: at android.app.ActivityThread.main(ActivityThread.java:6459)\r\n[WARN] W/System.err: at java.lang.reflect.Method.invoke(Native Method)\r\n[WARN] W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:938)\r\n[WARN] W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:828)\r\n[ERROR] TiExceptionHandler: (main) [17254,128066] ----- Titanium Javascript Runtime Error -----\r\n[ERROR] TiExceptionHandler: (main) [0,128066] - In ti:/invoker.js:101,19\r\n[ERROR] TiExceptionHandler: (main) [0,128066] - Message: Uncaught Couldn't read row 0, col 1 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it.\r\n[ERROR] TiExceptionHandler: (main) [0,128066] - Source: return delegate.apply(invoker.__thisObj__, args);\r\n[WARN] SystemReader: Cannot find supportKddiAuNaming, use default value instead\r\n[ERROR] V8Exception: Exception occurred at ti:/invoker.js:101: Uncaught Couldn't read row 0, col 1 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it.\r\n[ERROR] V8Exception: Couldn't read row 0, col 1 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it.\r\n{noformat}\r\n", "updateAuthor": { "name": "jonesdhtx", "key": "jonesdhtx", "displayName": "David Jones", "active": true, "timeZone": "America/Chicago" }, "created": "2018-03-02T15:19:30.000+0000", "updated": "2018-03-02T15:19:30.000+0000" }, { "id": "441213", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Everyone, the cloud photo selection issues are fixed in Titanium 7.3.0.\r\nWhen we added support for video selection in [TIMOB-24707], we ended up resolving the \"content://\" URL scheme issues we had.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-08-30T02:43:44.000+0000", "updated": "2018-08-30T02:43:44.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }