Open codeyourweb opened 6 years ago
Edit: Figured out the problem. You will encounter this error if you are using Expo as it is incompatible with this and react-native-sqlite-storage.
if you use https://docs.expo.io/versions/latest/sdk/sqlite, it worked for me, although it was slower.
In case someone else is dumb like me, and encounters this exact same error when using the package with the Android Emulator: Boy, don't forget to recompile and reinstall the app after installation of the npm package ... else the libraries won't be there #facepalm
@MrGurns, are you able to get this module to work with expo or did you completely forgo using react-native-sqlite-2? The reason I'm asking is because I'm trying to get react-native-pouchdb to work in Expo (at least for now I don't want to deal with ditching Expo).
@lucasvo I did get it working, but it isn't turned on anymore. I found my issue to be much deeper than the db engine. It turned out to be something with the server configuration. Instead of going through a port for SSL Verification, i ended up coding an endpoint that forwarded the SSL to Couchdb properly.
@codeyourweb, Please follow this scenario:-
Android
Open up android/app/src/main/java/[...]/MainApplication.java
Add import dog.craftz.sqlite_2.RNSqlite2Package;
to the imports at the top of the file
Add new RNSqlite2Package()
to the list returned by the getPackages()
method
Append the following lines to android/settings.gradle
:
include ':react-native-sqlite-2'
project(':react-native-sqlite-2').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-sqlite-2/android')
Insert the following lines inside the dependencies block in android/app/build.gradle
:
compile project(':react-native-sqlite-2')
How can i use Pre-populated SQLite database from my app
TIA
For iOS, don't forget to run pod install
after running the react-native link xxx
command.
Still not able to use this library because of this error. What's the status? Is there any alternative to the library if this is not being maintained?
Same here, not working. And using Expo (hence not Cocoa pods I think), therefore "pod install" mentioned above is not appropriate I think.
I'm still getting the "null is not an object (evaluating RNSqlite2.exec)" after doing "npx react-native link pouchdb-adapter-react-native-sqlite" as mentioned in related thread https://github.com/craftzdog/pouchdb-adapter-react-native-sqlite/issues/5
still not working
So I had the same issue, the issue comes from using expo go, if you build your source using npx expo run:android|ios
and then use a dev-client npx expo start --dev-client
this issue will not come up, in a managed or in bare workflow. even if you use expo-sqlite-storage
I've got a problem when starting an SQL transaction. It also appear on your test application. The database is correctly opened and there is no error before the first SQL transaction. It appears regardless of the number and the type of SQL queries.