Hi,
I have followed [SOLVED] Import asset DB but it does not work for me.
I have created a test.db from SqLite Browser on Mac 10.13.6. I placed it in ./assets/db/ next to my App.js.
import Expo, { SQLite, FileSystem, Asset } from ‘expo’;
Expo.FileSystem.downloadAsync(
Expo.Asset.fromModule(require(“./assets/db/test.db”)).uri,
${Expo.FileSystem.documentDirectory}SQLite/test.db
);
It returns "unable to resolve module for ./assets/db/test.db
.
I have in the app.json:
“assetBundlePatterns”: [ “**/*” ],
"packagerOpts": {
"assetExts": ["db"]
}
In componentDidMount(), I also have:
makeSQLiteDirAsync() {
const dbTest = SQLite.openDatabase(‘dummy.db’);
dbTest.transaction(tx => tx.executeSql(‘’));
}
Thank you.