Hi @ken122624. Can you try the following. If it does not give you any errors maybe you can compare it with your app to see what difference might be causing the problem:
Make sure expo-cli
version 3.0.10 is installed.
Then create a new blank project with expo init sqlite-test
.
This will set up a project with SDK 34, but you can change it back to SDK 33 as follows:
app.json:
{
"expo": {
"name": "sqlite-test",
"slug": "sqlite-test",
"privacy": "public",
"sdkVersion": "33.0.0",
"platforms": [
"ios",
"android"
],
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
"**/*"
],
"ios": {
"supportsTablet": true
}
}
}
package.json:
{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"eject": "expo eject"
},
"dependencies": {
"expo": "^33.0.7",
"react": "16.8.3",
"react-dom": "^16.8.6",
"react-native": "https://github.com/expo/react-native/archive/sdk-33.0.0.tar.gz"
},
"devDependencies": {
"babel-preset-expo": "^6.0.0"
},
"private": true
}
If you run yarn
and then expo diagnostics
you should get something like this:
$ expo diagnostics
Expo CLI 3.0.10 environment info:
System:
OS: ...
Shell: 4.3.11 - /bin/bash
Binaries:
Node: 12.6.0 - /usr/local/node/bin/node
Yarn: 1.17.3 - /usr/bin/yarn
npm: 6.11.1 - /usr/local/node/bin/npm
npmPackages:
expo: ^33.0.7 => 33.0.7
react: 16.8.3 => 16.8.3
react-native: https://github.com/expo/react-native/archive/sdk-33.0.0.tar.gz => 0.59.8
npmGlobalPackages:
expo-cli: 3.0.10
If you now expo install expo-sqlite
and change App.js
to the following, you should not get any errors:
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { SQLite } from 'expo-sqlite';
const db = SQLite.openDatabase("db.db");
export default function App() {
return (
<View style={styles.container}>
<Text>Open up App.js to start working on your app!</Text>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
});
I’ve just tried the above and I did not get any errors. Let us know what happens when you try it.