Skip to content
This repository has been archived by the owner on Dec 1, 2024. It is now read-only.

Level down not working in IOS/Android #731

Closed
Linoy339 opened this issue Aug 3, 2020 · 13 comments
Closed

Level down not working in IOS/Android #731

Linoy339 opened this issue Aug 3, 2020 · 13 comments
Labels
help wanted Extra attention is needed question Support or open question(s) stale This issue or pull request is old

Comments

@Linoy339
Copy link

Linoy339 commented Aug 3, 2020

Hi all,
I am trying to establish offline db using pouch db in mobile.
I have an application which uses node express and pouch db. Its running well in my pc. I was able to take a build using webpack and tried in android/ios, which is not working.
IOS Error:
Error: No native build was found for platform=ios arch=arm64 runtime=node abi=57 uv=1 armv=8 libc=glibc at load.path (/private/var/mobile/Containers/Data/Application/74907299-A8BC-40E0-98CC-A5D65DDA491C/Documents/nodejs-project/api/node_modules/node-gyp-build/index.js:56:3)

Android Error:
Error: dlopen failed: cannot locate symbol "napi_get_global" referenced by "/data/data/digital.lamp.mindlamp/files/lampBuild/api/node_modules/leveldown/prebuilds/android-arm64/node.napi.armv8.node"...

@vweevers
Copy link
Member

vweevers commented Aug 3, 2020

We don't have prebuilds for iOS (#626), you'll have to compile it yourself.

As for android, which version of node are you using? Note also that our android prebuilds are built against Node.js core rather than the nodejs-mobile fork.

@Linoy339
Copy link
Author

Linoy339 commented Aug 3, 2020

@vweevers .Thank you.
I'm using node version 12.18.0 against nodejs-mobile.

@Linoy339
Copy link
Author

Linoy339 commented Aug 3, 2020

Hi vweevers,

Can I have any way to use it against nodejs-mobile fork in both platforms?

@vweevers
Copy link
Member

vweevers commented Aug 3, 2020

You'll have to compile leveldown from source for both android and ios in that case.

npm install leveldown --build-from-source

@Linoy339
Copy link
Author

Linoy339 commented Aug 3, 2020

I'm sorry that I'm new to this. Do I need to do this in IOS/Android device ?

@vweevers
Copy link
Member

vweevers commented Aug 3, 2020

I don't know how nodejs-mobile works, so I can't be of further assistance.

@vweevers vweevers added help wanted Extra attention is needed question Support or open question(s) labels Aug 3, 2020
@Linoy339
Copy link
Author

Linoy339 commented Aug 3, 2020

Ok. Got it. This need to be done where nodejs-mobile project relies. Is it right?

eg: I have a directory /data/app.xxx.mobileapp/files/nodeprojectBuild/api/ in which nodeprojectBuild/api is the one where I put the node_modules. So its required to install from here(nodeprojectBuild/api ). Right?

@Linoy339
Copy link
Author

Linoy339 commented Aug 3, 2020

I don't know how nodejs-mobile works, so I can't be of further assistance.

Okay. Could you please spot a solution other than nodejs-mobile to work it out.?

Thank you for your help.

@vweevers
Copy link
Member

vweevers commented Aug 3, 2020

If you use Node.js core rather than nodejs-mobile, leveldown should "just work". You can use termux to try it out. You'll likely also need the latest version of leveldown (pouch db might be behind) because we fairly recently fixed a bug (#706).

@Linoy339
Copy link
Author

Linoy339 commented Aug 3, 2020

Okay. May I know how to do this for IOS?

@vweevers
Copy link
Member

vweevers commented Aug 3, 2020

I have no idea. I believe the manyverse app pulled it off, maybe look there for inspiration.

@vweevers vweevers added the stale This issue or pull request is old label Apr 10, 2021
@buu700
Copy link

buu700 commented Aug 29, 2021

@vweevers Would you consider supporting nodejs-mobile? Node.js core sounds great in theory, but it's been over a year and afaict it's still considered experimental with no easy way to embed into native Android or Cordova apps. I think it makes more sense to support something that works today than something that may (or may not) work eventually.

@vweevers
Copy link
Member

Node.js compiles successfully on Android, as does leveldown. If not, the Node.js project is open to improving Android support. They typically just need someone to champion it. Supporting forks of Node.js hinders that.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Extra attention is needed question Support or open question(s) stale This issue or pull request is old
Projects
None yet
Development

No branches or pull requests

3 participants