{ "id": "144902", "key": "AC-794", "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": "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": "2015-09-29T01:59:11.000+0000", "created": "2015-02-18T17:24:36.000+0000", "labels": [ "filesystem", "ios" ], "versions": [], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2016-03-08T07:37:04.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "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 a db file is shipped in resources and installed by providing its absolute path, the install function fails to find the file if the path contains spaces (i.e. the app name contains spaces)\r\n\r\nThis was introduced in commit https://github.com/appcelerator/titanium_mobile/commit/d0db5dab7ba6e91642bedbc4fec946e38d23b5b3 which replaced the absoluteString with path in Ti.FileSystem.ResourcesDirectory\r\n\r\nAs a result, the string passed to the install function contains unescaped spaces which affect the logic of the function. (in Ti 3.4.1 and earlier the path passed to the install function contains %20)\r\n\r\nTo reproduce: Create a new classic project containing a space in the project name and put a file in resources named mydb.db then try running the following code with Ti 3.5 or newer\r\n\r\n{code}\r\nTitanium.Database.install(Titanium.Filesystem.resourcesDirectory+'mydb.db','db');\r\n{code}\r\n\r\nYou should get something like the following error:\r\n\r\n{noformat}\r\n[ERROR] : Script Error {\r\n[ERROR] : column = 26;\r\n[ERROR] : line = 1;\r\n[ERROR] : message = \"Could not retrieve attributes\";\r\n[ERROR] : nativeLocation = \"-[TiDatabaseProxy install:name:] (TiDatabaseProxy.m:131)\";\r\n[ERROR] : nativeReason = \"Error Domain=NSCocoaErrorDomain Code=260 \\\"The operation couldn\\U2019t be completed. (Cocoa error 260.)\\\" UserInfo=0x7fdf1944d290 {NSFilePath=/Users/userx/Library/Developer/CoreSimulator/Devices/ABE968BE-F288-48F7-B714-A065B48472B8/data/Containers/Bundle/Application/3A077915-566E-4B26-8237-72D551068655/db Test.app/Users/userx/Library/Developer/CoreSimulator/Devices/ABE968BE-F288-48F7-B714-A065B48472B8/data/Containers/Bundle/Application/3A077915-566E-4B26-8237-72D551068655/db Test.app/mydb.db, NSUnderlyingError=0x7fdf1944d5f0 \\\"The operation couldn\\U2019t be completed. No such file or directory\\\"}\";\r\n[ERROR] : sourceURL = \"file:///Users/userx/Library/Developer/CoreSimulator/Devices/ABE968BE-F288-48F7-B714-A065B48472B8/data/Containers/Bundle/Application/3A077915-566E-4B26-8237-72D551068655/db%20Test.app/app.js\";\r\n[ERROR] : stack = \"[native code]\\nglobal code@file:///Users/userx/Library/Developer/CoreSimulator/Devices/ABE968BE-F288-48F7-B714-A065B48472B8/data/Containers/Bundle/Application/3A077915-566E-4B26-8237-72D551068655/db%20Test.app/app.js:1:26\";\r\n[ERROR] : }\r\n{noformat}", "attachment": [], "flagged": false, "summary": "Ti Database install failure when absolute path containing spaces is passed", "creator": { "name": "hini", "key": "hini", "displayName": "Hani Hamadeh", "active": true, "timeZone": "Asia/Beirut" }, "subtasks": [], "reporter": { "name": "hini", "key": "hini", "displayName": "Hani Hamadeh", "active": true, "timeZone": "Asia/Beirut" }, "environment": "iOS 8.1 Ti SDK 3.5 Mac", "comment": { "comments": [ { "id": "361091", "author": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hello,\r\n\r\nI tested the issue you reported. We did not reproduce this issue as a bug. It works as expected.\r\n\r\nSo I recommend you upgrade studio and SDK to the latest build and use \".sqlite\" extension initiate of \".db\" then let us know if you get the error again.\r\n\r\n{code}\r\nvar db = Titanium.Database.install(Titanium.Filesystem.resourcesDirectory + 'mydatabase.sqlite', 'mydatabase');\r\n{code}\r\n\r\nThanks", "updateAuthor": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-08-25T10:45:57.000+0000", "updated": "2015-09-29T01:59:04.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }