I have tried to open Sqlite database using react-native for android application but couldn't open using prepopulated database stored inside assets directory of the project.
I have removed location and createfromLocation from the openDataBase code databae was created in android device which would be empty without schema and data. I can populate data from the code but this doesn't make any sense. So What might be the mistake that I am making.Am I missing something here?
Code(App.js file):
const db = SQLite.openDatabase(
{
name: 'Recipe.db',
location: 'default',
createFromLocation: '~Recipe.db',
}
Log:
OPEN database: Recipe.db
05-20 09:22:23.620 5975 6009 I ReactNativeJS: new transaction is waiting for open operation
05-20 09:22:23.629 5975 6009 I ReactNativeJS: OPEN database: Recipe.db failed, aborting any pending transactions
05-20 09:22:23.632 5975 6009 I ReactNativeJS: { [Error: Could not open database]
05-20 09:22:23.632 5975 6009 I ReactNativeJS: code: 0,
05-20 09:22:23.632 5975 6009 I ReactNativeJS: line: 100047,
05-20 09:22:23.632 5975 6009 I ReactNativeJS: column: 27,