-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error in leveldown of pouchdb #121
Comments
Hi @Bishalsahoo , I've been unable to reproduce this error. It ran on a arm64 Android 7.0 device. I've tried to reproduce it and the At runtime, some modules seem to expect the current working directory to be a writable directory to save some temporary lock and log files, so I've also had to change the current working directory with Did your project compile without applying the leveldown patch? If so, it might be skipping native modules compilation. Also, your module seems to be inside Please provide more information or a repo with your project, since the runtime path for loading leveldown is unusual. |
Sorry for the late reply , the basic of my main project is to be able to sync data seemlessly among different devices running my Cordova Android or iOS app with the help of nodejs server running in the backend . So I started with the pouch Todo example along with express pouch server in the backend . When I am trying to install the dependencies for the same like express express pouchdb memdown ..... in the nodejs project folder it is unable to find the modules , even after mentioning in the .dir file . So I just tried to move it to the folder where the Cordova bridge module exists and it worked fine as long as I am using memdown for the pouchdb ie storing data in the memory for the server. But when I tried to store the same data through the code I mentioned above it shows error in the Cordova nodejs plugin as mentioned above (even though my app works perfectly and stores data in the local storage for the front end but for server it shows the error in the Android studio and even in the data base of the server when I am accessing it through the browser. This above server code works perfectly fine on my browser as client and running the server in the terminal . As you mentioned it works fine without any error , can you please be able to provide me the sample of the same so that I can go through it and see why am I facing the issue . It will be a great help . Thank you |
Hi @mavericksthinker , I think that's the most useful sample to help you understand the structure of the project and using native modules. |
Yes I have gone through that example and started building this project . I have tried that workaround and still the build fails.
Here is the small example that will reproduce the same error Repo Steps used to create the project: Please If you can provide a workaround/suggestion that will be a great help. Another question , I am unable to make the node module start on android version@5,6.0.1. It only worked on android@7(Nougat) . Is there a way to make the node start on the other versions of the android mentioned above. |
Hi @Bishalsahoo , I've just tried building from your repo, and was able to
(You can try with the Regarding the android versions, I'm suspecting you are using a simulator, which contain older versions of WebView. This issue might be helpful: #119 (comment) |
Thank you I was able to solve the problem by applying the workaround , but is it possible to use Cordova plugin file on the nodejs side? So that we can change the directory to store the data on android. One more thing is the app that I build with the same has huge amount of data stored in the app even though no data is actually stored ,why that happens? |
It's not possible to use cordova plugins on the nodejs side. You should use the channel to make the calls you need. For storing the data, you can pass the paths from Cordova to node or use this API: https://github.com/janeasystems/nodejs-mobile-cordova/tree/be459ac4702a825a9254be03fc9448a5487436db#cordovaappdatadir Node expects to run the project from a file system, so the project is copied to files, as specified in the README: https://github.com/janeasystems/nodejs-mobile-cordova/tree/be459ac4702a825a9254be03fc9448a5487436db#node-modules
|
Hello @jaimecbernardo, thank you for the response . I actually was able to build the app by changing the version of gradle as I was getting new thread can be created on gradle 4.4. But can you specify which version of gradle were you using for the build? And another question I kept all the required node modules in the nodejs_project and the build was completed but when I ran it even though modules like express express-Pouchdb ,corser were installed still it throws err module can be found . I checked the build folder and all the modules are present but I am unaware why this error is produced . Can you help me with this please? |
Hi @mavericksthinker , I have Gradle '4.6.0' installed in the system but the Cordova project in the Native Module Samples should be using a Gradle Wrapper for '4.1', according to the used This can be verified by running Regarding the error you mention, it sounds like it's a project or module specific issue. Do you have a log of the exact error you're getting with a replication repo and instructions on how to replicate that could be looked into? Starting with the |
Hello @jaimecbernardo , thank you for your response. Yes I will try to provide you the error log or a sample report that provides the same error. Just wanted to ask is there a way to make the server running on the nodejs module to work in background like whatsapp notification services so that the server will be on once the phone boots or is on ? |
Hello @jaimecbernardo , I have an issue with building the node_modules . I am getting following error while running the cordova build npm ERR! A complete log of this run can be found in: FAILURE: Build failed with an exception.
BUILD FAILED in 4m 12s The sqlite3 Module is not building . I am using "dependencies": { these dependencies . Please can you give any suggestion how to fix this |
Hi @mavericksthinker , For having it run in the background once the phone turns on I think you'd probably have to hook up the native library as an Android service, or having the Application start as the phone starts but you'd have to check how to do that for Cordova Apps if it's possible (or general Apps). Either way, once the App is started it can be expected to keep running in the background since the nodejs-mobile engine is running native code, according to the Android docs: https://developer.android.com/training/articles/perf-jni Regarding the error, I don't seem to notice what is occurring, from the logs provided. Have you been able to build the sample repo linked earlier? It uses sqlite3, as well. |
Hi @algorist-mechanism , @jaimecbernardo , I try pouchdb version 7.0.0 and I have the same issue: UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: dlopen failed: cannot locate symbol "napi_create_external" referenced by "/data/data/com.yourorg.sample/files/nodejs-project/node_modules/pouchdb/node_modules/leveldown/prebuilds/android-arm/node-napi.node"... Have you solved this problem? |
Hi @bavuvanet, I'll answer in #159, where this comment is duplicated. |
Hello , I have been working on a project where I creating a express-pouchdb server
Here is the sample
But I am getting following error
Can anyone please help to solve this problem of using 64bit or any alternatives to this?
Thank you in advance.
The text was updated successfully, but these errors were encountered: