{ "id": "160110", "key": "TIMOB-23386", "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": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2016-05-19T03:17:20.000+0000", "created": "2016-05-07T18:58:19.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "Android", "database", "iOS", "sqlite" ], "versions": [ { "id": "17993", "description": "Release 5.2.2", "name": "Release 5.2.2", "archived": false, "released": true, "releaseDate": "2016-04-05" } ], "issuelinks": [], "assignee": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "updated": "2017-03-24T17:57:11.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": "When we place the sqlite database file into the asset or lib folder of Alloy project then it can not detect the table inside the dataBase file and always shows the below error. \r\n\r\nh6.Steps To Reproduce\r\n1. Just create a Alloy project.\r\n2. Paste the following code into the index.js file\r\n3. Download the database file and paste into the lib or assets folder.\r\n4. Finally, run your project.\r\n\r\nNote: If you open the dataBase file by the sqlite manager, you can see the dataBase table.\r\n\r\n\r\nh6.Test Code\r\n{code:title=index.js}\r\nfunction doCllick(e) {\r\n\r\n\tvar db = Ti.Database.install('m9data.sqlite', 'm9data'); \r\n\tvar result = db.execute(\"select*from config\");\r\n\tTi.API.info(\"DataBaseTest\" + result);\r\n\tdb.close(); \r\n\r\n}\r\n\r\n$.index.open();\r\n\r\n{code}\r\n\r\nh6.Android Error\r\n{code:title=Android_error}\r\n[ERROR] : TiExceptionHandler: (main) [59,235057] ----- Titanium Javascript Runtime Error -----\r\n[ERROR] : TiExceptionHandler: (main) [0,235057] - In undefined:14,25\r\n[ERROR] : TiExceptionHandler: (main) [0,235057] - Message: Uncaught Error: no such table: config (code 1): , while compiling: select*from config\r\n[ERROR] : TiExceptionHandler: (main) [0,235057] - Source: var result = db.execute(\"select*from config\");\r\n{code}", "attachment": [ { "id": "59290", "filename": "app.zip", "author": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "created": "2016-05-18T18:50:59.000+0000", "size": 1494277, "mimeType": "application/zip" }, { "id": "59161", "filename": "m9data.sqlite", "author": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2016-05-07T18:31:24.000+0000", "size": 65536, "mimeType": "application/octet-stream" } ], "flagged": false, "summary": "Android: SQLite dataBase file is not installed properly.", "creator": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "subtasks": [], "reporter": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "environment": "Appcelerator Command-Line Interface, version 5.2.2\r\nNode.js\r\n Node.js Version = 4.2.2\r\n npm Version = 2.14.7\r\nTitanium CLI\r\n CLI Version = 5.0.6\r\nTitanium SDK\r\n SDK Version = 5.2.2.GA\r\nPlatform = Android, iOS", "closedSprints": [ { "id": 627, "state": "closed", "name": "2016 Sprint 10 SDK", "startDate": "2016-05-07T00:43:56.954Z", "endDate": "2016-05-21T00:43:00.000Z", "completeDate": "2016-05-23T02:06:04.349Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "385990", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "Adding classic app as example:-\r\n{code}\r\nvar win = Ti.UI.createWindow();\r\nwin.addEventListener('open', function(){\r\n \r\n \r\nvar db = Ti.Database.install('m9data.sqlite','m9datadb');\r\nvar dbOpen = Ti.Database.open('m9datadb');\r\nallData = dbOpen.execute(\"SELECT * FROM config\");\r\nwhile (allData.isValidRow()) {\r\n //var name = allData.fieldByName('name');\r\n //Ti.API.info(\"DB name:\"+name);\r\n \r\n var cod = allData.fieldByName('AgencyCode');\r\n var tag = allData.fieldByName('ServiceTag');\r\n var bit = allData.fieldByName('FeatureBit');\r\n var city = allData.fieldByName('AgencyCity');\r\n Ti.API.info(cod + ' ' + tag + ' ' + bit + ' ' + city + ' ');\r\n \r\n allData.next();\r\n}\r\ndbOpen.close();\r\n \r\n});\r\n \r\nwin.open();\r\n{code}\r\nm9data.sqlite was placed in `Resources` folder for this classic app.", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-05-18T04:13:14.000+0000", "updated": "2016-05-18T04:13:14.000+0000" }, { "id": "386088", "author": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "body": "[~msamah] attached alloy app using {{m9data.sqlite}}.", "updateAuthor": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "created": "2016-05-18T18:52:15.000+0000", "updated": "2016-05-18T18:52:15.000+0000" }, { "id": "386137", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "Thank you [~fmiao]", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-05-19T03:17:32.000+0000", "updated": "2016-05-19T03:17:32.000+0000" }, { "id": "386139", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-05-19T03:20:10.000+0000", "updated": "2016-05-19T03:20:10.000+0000" }, { "id": "415595", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as invalid with reference to the above comments.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-24T17:57:11.000+0000", "updated": "2017-03-24T17:57:11.000+0000" } ], "maxResults": 12, "total": 12, "startAt": 0 } } }