How fix error with SQLite file: “Can’t find variable”?

Hi, I’m new in React Native and I wanna connect a pre populated SQLite database with my project and make a insert with a register form, when I run my app in the Android Emulator appears that in the following image happens, my app can’t find my db file (ProjectDB.db (I can’t publicate the actual name)). (The error in Android Studio and the file locations):

Other solutions on Internet haven’t worked for me and I don’t understand what I’m doing wrong

// import * as FileSystem from 'expo-file-system';
// import {openDatabase} from 'react-native-sqlite-storage';
//import { SQLite } from 'expo';

import * as SQLite from 'expo-sqlite';

//Database conexion

const db = SQLite.openDatabase({name: ProjectDB.db, createFromLocation: 1});

HERE I call my db like just as a tutorial would suggest to me
I tried to do something with Asset, FileSystem and Async and it didn’t work for me.
And f I use openDatabase from “react-native-sqlite-storage” the following error appears:
“null is not an object (evaluating 'NativeModules[“SQLite”][method])”
Please, help me, I don’t understand what I may need in my code.

Hello, any update on this issue for you?

Hey @niteews92, if you are facing that issue, I’d suggest taking a look at our SQLite docs: SQLite - Expo Documentation to configure the metro.config.js to include the .db file format as an asset and using expo-file-system to open the database.

Hi Aman, thank you for your response.

I’m able to get the database to load using expo-file-system and I’ve configured the metro.config.js. It works when I test it on Expo Go; however, when I build the App and test it on TestFlight, I can only get the database to partially load. Here is my request for help with more details on Stack Overflow.

I’ve been trying to fix this bug for months! Any help is great appreciated!