Open ansoncsh opened 5 years ago
Hi @ansoncsh ,
sqlite3
is a native module, which means it has to be compiled for the OS/architectures it'll run on.
The plugins have code for compiling native modules on their Gradle file and adding them to the APK assets: https://github.com/janeasystems/nodejs-mobile-cordova/blob/4a79e96b8f313296fb050ecc413f053d1ac7f5c8/src/android/build.gradle
You'd have to do something similar for your native application. There are yet no samples to use native modules outside the plugins.
how build for ios?
@ansoncsh ansoncsh Did you solve this?
I try to remember as it was long time ago 😅
As I remember, we finally built the app by using React Native. A bridge is developed for communication between nodejs and React Native app. Such that nodejs application could send data to React Native app.
i.e.
I guess Native App can do it similarly
Hi,
I am trying to build a nodejs application in an Android native app. I want to use sqlite3 module in the app. However I have got the following error.
I guess it is because I run npm install on my Mac and so it builds the node_sqlite3.node based on my Mac's version. nodejs-project/node_modules/sqlite3/lib/binding/node-v64-darwin-x64/node_sqlite3.node
How can I build the module based on different device versions? Or is there any suggestion to support sqlite from both Android native app and nodejs application?
Note: cordova can work fine but not for Android native.
Thank you!