I downloading a simple database structure in the SQLite folder inside the documents directory. When I am trying to use it I am getting an error.
ERROR Error opening database: [Error: Call to function 'NativeDatabase.constructor' has been rejected. → Caused by: Could not open database - name[file:///data/user/0/host.exp.exponent/files/SQLite/NuseryStats.db]]
Here is my code:
`const useDatabase = async (): Promise<any | boolean> => {
try {
const dbPath = `${FileSystem.documentDirectory}SQLite/${LocalDBName}`;
console.log(dbPath)
const db = await SQLite.openDatabaseAsync(dbPath);
return db;
} catch (error) {
console.error('Error opening database:', error);
return false;
}
};`
I have checked that the file exists in the directory.