{ "id": "174589", "key": "AC-6460", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2020-02-05T22:33:16.000+0000", "created": "2019-12-20T19:30:56.000+0000", "labels": [ "android-10", "android-8", "android-9" ], "versions": [], "issuelinks": [], "assignee": { "name": "nsalahin", "key": "nsalahin", "displayName": "Nazmus Salahin", "active": true, "timeZone": "Asia/Dhaka" }, "updated": "2020-09-11T18:38:46.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": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "When trying to delete a file inside applicationDataDir, android crashes with the following log:\r\n\r\n\r\n{code:java}\r\n[ERROR] TiExceptionHandler: (main) [1030,328883] ti:/invoker.js:105\r\n[ERROR] TiExceptionHandler: \t\treturn delegate.apply(invoker.__thisObj__, args);\r\n[ERROR] TiExceptionHandler: ^\r\n[ERROR] TiExceptionHandler: Error: Attempt to invoke virtual method 'java.lang.String java.lang.String.toLowerCase()' on a null object reference\r\n[ERROR] TiExceptionHandler: at SandboxAPI.invoker [as getFile] (ti:/invoker.js:105:19)\r\n[ERROR] TiExceptionHandler: at Object.exports.getf (/api.js:136:21)\r\n[ERROR] TiExceptionHandler: at deleteFiles (/form/form4.js:2240:5)\r\n[ERROR] TiExceptionHandler: at Titanium.checkStatus (/form/form4.js:2191:1)\r\n[ERROR] TiExceptionHandler:\r\n[ERROR] TiExceptionHandler: org.appcelerator.titanium.io.TiFileFactory.createTitaniumFile(TiFileFactory.java:88)\r\n[ERROR] TiExceptionHandler: org.appcelerator.titanium.TiFileProxy.(TiFileProxy.java:83)\r\n[ERROR] TiExceptionHandler: ti.modules.titanium.filesystem.FileProxy.(FileProxy.java:18)\r\n[ERROR] TiExceptionHandler: ti.modules.titanium.filesystem.FilesystemModule.getFile(FilesystemModule.java:92)\r\n[ERROR] TiExceptionHandler: org.appcelerator.kroll.runtime.v8.V8Function.nativeInvoke(Native Method)\r\n[ERROR] TiExceptionHandler: org.appcelerator.kroll.runtime.v8.V8Function.callSync(V8Function.java:55)\r\n[ERROR] TiExceptionHandler: org.appcelerator.kroll.runtime.v8.V8Function.call(V8Function.java:41)\r\n[ERROR] TiExceptionHandler: ti.modules.titanium.TitaniumModule$Timer.run(TitaniumModule.java:167)\r\n[ERROR] TiExceptionHandler: android.os.Handler.handleCallback(Handler.java:873)\r\n[ERROR] TiExceptionHandler: android.os.Handler.dispatchMessage(Handler.java:99)\r\n[ERROR] V8Exception: Exception occurred at ti:/invoker.js:105: Uncaught Error: Attempt to invoke virtual method 'java.lang.String java.lang.String.toLowerCase()' on a null object reference\r\n{code}\r\n\r\n\r\nThe code that's triggering is:\r\n\r\n\r\n{code:java}\r\nvar photoCacheDir = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, \"myapp\");\r\nif (!photoCacheDir.exists()) { photoCacheDir.createDirectory(); }\r\n\r\nTi.Filesystem.getFile(photoCacheDir.resolve(), fname).deleteFile();\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "Android is crashing when trying to delete a file in applicationDataDir", "creator": { "name": "perdona", "key": "perdona", "displayName": "Caio Perdona", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "perdona", "key": "perdona", "displayName": "Caio Perdona", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Operating System\r\n Name = Mac OS X\r\n Version = 10.15.2\r\n Architecture = 64bit\r\n # CPUs = 12\r\n Memory = 16.0GB\r\n\r\nNode.js\r\n Node.js Version = 10.16.3\r\n npm Version = 6.9.0\r\n\r\nTitanium CLI\r\n CLI Version = 5.2.2\r\n node-appc Version = 0.2.49\r\n\r\nTi-SDK 8.3.0.GA", "comment": { "comments": [ { "id": "453278", "author": { "name": "nsalahin", "key": "nsalahin", "displayName": "Nazmus Salahin", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hello!\r\n\r\nThanks for reaching to us. What is your Ti SDK version? Could you share the steps to reproduce the issue in our end? Also, please share the complete trace.\r\n\r\nThanks", "updateAuthor": { "name": "nsalahin", "key": "nsalahin", "displayName": "Nazmus Salahin", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2019-12-21T05:50:27.000+0000", "updated": "2019-12-21T05:50:27.000+0000" }, { "id": "453315", "author": { "name": "perdona", "key": "perdona", "displayName": "Caio Perdona", "active": true, "timeZone": "America/Los_Angeles" }, "body": "@Nazmus Ti-SDK 8.3.0.GA\r\nI've already provided the steps to reproduce.\r\n\r\nvar photoCacheDir = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, \"myapp\");\r\nif (!photoCacheDir.exists()) { photoCacheDir.createDirectory(); }\r\n \r\nTi.Filesystem.getFile(photoCacheDir.resolve(), fname).deleteFile();\r\n\r\n\r\nWhen Ti tries to delete the file, the app crashes with the log given above.", "updateAuthor": { "name": "perdona", "key": "perdona", "displayName": "Caio Perdona", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-12-26T14:11:44.000+0000", "updated": "2019-12-26T14:11:44.000+0000" }, { "id": "453410", "author": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "[~perdona] I could not reproduce this issue. Please try with this sample code\r\n\r\n{code:java}\r\n// create our starting file\r\nvar f = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, 'myfile.txt');\r\nf.write('This is not empty');\r\n\r\n// get a handle to the as-yet non-existent directory\r\nvar dir = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory, 'mysubdir');\r\n\r\nif (dir.exists() == false) {\r\n\t// this creates the directory\r\n\tTi.API.info('Directory list to start: ' + dir.getDirectoryListing());\r\n\tdir.createDirectory();\r\n\t// let's move myfile.txt to our directory\r\n\tf.move('mysubdir/myfile.txt');\r\n\t\r\n}\r\n\r\n// output a directory listing\r\nTi.API.info('Dir list with file: ' + dir.getDirectoryListing());\r\n\r\nvar contents = f.read();\r\nTi.API.info('Output as a blob: ' + contents);\r\n// useful if contents are binary\r\nTi.API.info('Output text of the file: ' + contents.text);\r\n\r\nTi.Filesystem.getFile(dir.resolve(), f).deleteFile();\r\n{code}\r\n\r\nIf the issue persists then share a runnable test case.\r\n\r\nThanks!", "updateAuthor": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2019-12-30T16:12:21.000+0000", "updated": "2019-12-30T16:12:21.000+0000" }, { "id": "453447", "author": { "name": "perdona", "key": "perdona", "displayName": "Caio Perdona", "active": true, "timeZone": "America/Los_Angeles" }, "body": "@Motiur, it is still happening here.\r\nFollowed the same steps as you've done above.\r\n\r\nTurns out that the bug happens on the line with \"Ti.Filesystem.getFile(dir.resolve(), f)\"\r\nWhen I downgrade SDK to 8.2.1.GA the bug DOES NOT HAPPEN.\r\n\r\n\r\nHow do we proceed?", "updateAuthor": { "name": "perdona", "key": "perdona", "displayName": "Caio Perdona", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-01-06T19:46:37.000+0000", "updated": "2020-01-06T19:46:37.000+0000" }, { "id": "453504", "author": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "[~perdona] Can you please share a reproducible test case? I could not reproduce the crash? ", "updateAuthor": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2020-01-08T15:37:07.000+0000", "updated": "2020-01-08T15:37:07.000+0000" }, { "id": "453522", "author": { "name": "AppDev", "key": "appdev", "displayName": "AppDev", "active": true, "timeZone": "Europe/Berlin" }, "body": "Happens to us as well on Android with 8.3.0.GA. Downgrading to 8.2.1.GA helped luckily. Unfortunately I am currenty unable to provide another test case. Would appreciate a fix though. Perhaps related to file system access permissions?", "updateAuthor": { "name": "AppDev", "key": "appdev", "displayName": "AppDev", "active": true, "timeZone": "Europe/Berlin" }, "created": "2020-01-09T09:15:30.000+0000", "updated": "2020-01-09T09:15:30.000+0000" }, { "id": "453523", "author": { "name": "perdona", "key": "perdona", "displayName": "Caio Perdona", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Same here @AppDev. ", "updateAuthor": { "name": "perdona", "key": "perdona", "displayName": "Caio Perdona", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-01-09T14:30:57.000+0000", "updated": "2020-01-09T14:30:57.000+0000" }, { "id": "453524", "author": { "name": "perdona", "key": "perdona", "displayName": "Caio Perdona", "active": true, "timeZone": "America/Los_Angeles" }, "body": "@Motiur, now I really don't have the time to share a runnable app, and this is kind of ineffective, bearing in mind that my app might have other properties and implementations that are different than the sample I would share, thus not reproducing the crash. ", "updateAuthor": { "name": "perdona", "key": "perdona", "displayName": "Caio Perdona", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-01-09T14:33:38.000+0000", "updated": "2020-01-09T14:33:38.000+0000" }, { "id": "453710", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This is addressed by https://github.com/appcelerator/titanium_mobile/pull/11395", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-01-15T00:21:35.000+0000", "updated": "2020-01-15T00:21:35.000+0000" }, { "id": "454066", "author": { "name": "ygbr", "key": "ygbr", "displayName": "Ygor Lemos", "active": true, "timeZone": "America/Sao_Paulo" }, "body": "@Gary, is this expected to drop on 8.3.2.GA ?", "updateAuthor": { "name": "ygbr", "key": "ygbr", "displayName": "Ygor Lemos", "active": true, "timeZone": "America/Sao_Paulo" }, "created": "2020-02-05T20:52:24.000+0000", "updated": "2020-02-05T20:52:24.000+0000" }, { "id": "454071", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~ygbr] Looks like it's only scheduled for 9.0.0.GA", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-02-05T22:33:03.000+0000", "updated": "2020-02-05T22:33:03.000+0000" }, { "id": "454304", "author": { "name": "ygbr", "key": "ygbr", "displayName": "Ygor Lemos", "active": true, "timeZone": "America/Sao_Paulo" }, "body": "Isn't this critical enough for backporting the fix to 8.X.X?", "updateAuthor": { "name": "ygbr", "key": "ygbr", "displayName": "Ygor Lemos", "active": true, "timeZone": "America/Sao_Paulo" }, "created": "2020-02-17T18:03:28.000+0000", "updated": "2020-02-17T18:03:28.000+0000" }, { "id": "454305", "author": { "name": "ygbr", "key": "ygbr", "displayName": "Ygor Lemos", "active": true, "timeZone": "America/Sao_Paulo" }, "body": "PS: it seems simple enough for backporting the fix by applying https://github.com/appcelerator/titanium_mobile/pull/11395/files to https://github.com/appcelerator/titanium_mobile/blob/e9ef3702af3f75327af9056ec0bb9a7bf209e130/android/titanium/src/java/org/appcelerator/titanium/io/TitaniumBlob.java#L89\r\n\r\nThis has become a blocker on our main production app since we can't delete files anymore on android, filling users storage unnecessarily.", "updateAuthor": { "name": "ygbr", "key": "ygbr", "displayName": "Ygor Lemos", "active": true, "timeZone": "America/Sao_Paulo" }, "created": "2020-02-17T18:10:16.000+0000", "updated": "2020-02-17T18:10:16.000+0000" }, { "id": "454308", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~ygbr]: here is the 8.3.1 branch with the TitaniumBlob changes merged in: https://migaweb.de/mobilesdk-8.3.1-linux.zip", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2020-02-17T20:49:34.000+0000", "updated": "2020-02-17T20:49:34.000+0000" }, { "id": "454309", "author": { "name": "perdona", "key": "perdona", "displayName": "Caio Perdona", "active": true, "timeZone": "America/Los_Angeles" }, "body": "@miga Can you provide the OSX version, please?", "updateAuthor": { "name": "perdona", "key": "perdona", "displayName": "Caio Perdona", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-02-17T23:10:48.000+0000", "updated": "2020-02-17T23:10:48.000+0000" }, { "id": "454310", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "since it is only an Android change you can just rename the linux part to osx or use the iOS version from here: http://builds.appcelerator.com/#8_3_X and replace the Android folder with the one from my zip", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2020-02-18T07:43:16.000+0000", "updated": "2020-02-18T07:43:16.000+0000" }, { "id": "456801", "author": { "name": "Snigdha.Nooli", "key": "snigdha.nooli", "displayName": "Snigdha Nooli", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Hi Michael, \r\n\r\nWe are facing the same issue in production with 8.3.1GA SDK. Unfortunately we can't move to 9.0 GA SDK currently. \r\nWe tried to use above 8.3.1 branch with bob changes but could not access the link https://migaweb.de/mobilesdk-8.3.1-linux.zip\r\nCould you please help us on this.\r\n\r\n", "updateAuthor": { "name": "Snigdha.Nooli", "key": "snigdha.nooli", "displayName": "Snigdha Nooli", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2020-09-09T22:21:20.000+0000", "updated": "2020-09-09T22:21:20.000+0000" }, { "id": "456826", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~Snigdha.Nooli] I've rebuild the SDK and the link is working again. Normally you can just clone the repo, include the PR and build it yourself", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2020-09-10T16:22:09.000+0000", "updated": "2020-09-10T16:22:09.000+0000" }, { "id": "456852", "author": { "name": "Snigdha.Nooli", "key": "snigdha.nooli", "displayName": "Snigdha Nooli", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Thanks for the help Michael.", "updateAuthor": { "name": "Snigdha.Nooli", "key": "snigdha.nooli", "displayName": "Snigdha Nooli", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2020-09-11T18:38:46.000+0000", "updated": "2020-09-11T18:38:46.000+0000" } ], "maxResults": 19, "total": 19, "startAt": 0 } } }