[TIMOB-23386] Android: SQLite dataBase file is not installed properly.
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2016-05-19T03:17:20.000+0000 |
Affected Version/s | Release 5.2.2 |
Fix Version/s | n/a |
Components | Android |
Labels | Android, database, iOS, sqlite |
Reporter | Motiur Rahman |
Assignee | Ashraf Abu |
Created | 2016-05-07T18:58:19.000+0000 |
Updated | 2017-03-24T17:57:11.000+0000 |
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.
Steps To Reproduce
1. Just create a Alloy project. 2. Paste the following code into the index.js file 3. Download the database file and paste into the lib or assets folder. 4. Finally, run your project. Note: If you open the dataBase file by the sqlite manager, you can see the dataBase table.Test Code
function doCllick(e) {
var db = Ti.Database.install('m9data.sqlite', 'm9data');
var result = db.execute("select*from config");
Ti.API.info("DataBaseTest" + result);
db.close();
}
$.index.open();
Android Error
[ERROR] : TiExceptionHandler: (main) [59,235057] ----- Titanium Javascript Runtime Error -----
[ERROR] : TiExceptionHandler: (main) [0,235057] - In undefined:14,25
[ERROR] : TiExceptionHandler: (main) [0,235057] - Message: Uncaught Error: no such table: config (code 1): , while compiling: select*from config
[ERROR] : TiExceptionHandler: (main) [0,235057] - Source: var result = db.execute("select*from config");
Attachments
File | Date | Size |
---|---|---|
app.zip | 2016-05-18T18:50:59.000+0000 | 1494277 |
m9data.sqlite | 2016-05-07T18:31:24.000+0000 | 65536 |
Adding classic app as example:-
m9data.sqlite was placed in
Resources
folder for this classic app.[~msamah] attached alloy app using
m9data.sqlite
.Thank you [~fmiao]
Closing ticket as invalid with reference to the above comments.