Using pre-populated SQLite in App

  1. SDK Version: 3.21.3
  2. Platforms(Android/iOS/web/all):Android/iOS

Hello, I’m trying to use the recipe described here:[SOLVED] Import asset DB
without any luck, below is App.js:

import React from ‘react’;

import { createStore, combineReducers, applyMiddleware } from ‘redux’;
import { Provider } from ‘react-redux’;
import initReducer from ‘./store/reducers/db’;
import ReduxThunk from ‘redux-thunk’;
import AppNavigator from ‘./navigation/AppNavigator’;
import * as FileSystem from ‘expo-file-system’;
import * as Asset from ‘expo-asset’;

const rootReducer = combineReducers({

init: initReducer


const store = createStore(rootReducer, applyMiddleware(ReduxThunk));

const makeSQLiteDirAsync = async () => {

const dbTest = SQLite.openDatabase(‘dummy.db’);

try {

await dbTest.transaction(tx => tx.executeSql(''));

} catch(e) {

if (this.state.debugEnabled) console.log('error while executing SQL in dummy DB');



export const initDictionaries = () => {


const dictionariesURI = Asset.fromModule(require(’./assets/dictionaries.db’)).uri;






const dbDictionaries = SQLite.openDatabase(‘dictionaries.db’);



export default function App() {

return (

<Provider store={store}>

  <AppNavigator />




Every time I get message like that :

“Unable to resolve “./assets/dictionaries.db” from “App.js”
Failed building JavaScript bundle.”

hi there! you need to add the .db extension to the list of supported assetExts. here’s an example:

you can copy that example into metro.config.js in your project and install @expo/metro-config, then restart the packager and it should work

It works thank you very much!!!

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.