nodejs-mobile / nodejs-mobile-react-native

Node.js for Mobile Apps React Native plugin
https://nodejs-mobile.github.io
MIT License
171 stars 41 forks source link

Native dependencies not building #19

Open manashathparia opened 2 years ago

manashathparia commented 2 years ago

I am trying to use Webtorrent with nodejs-mobile, which has a native dependency utp-native. But while building the app Gradle just ignores the native dependency and builds the apk

freddi301 commented 2 years ago

I've tried with upt-native-nodejs-mobile but when running the app it says "cannot locate upt-native.node" (tried to build on windows and linux) BUILD_NATIVE_MODULES.txt is set to 1

freddi301 commented 2 years ago

update: to use tp-native on mobile as of now you can replace it with utp-native-nodejs-mobile

manashathparia commented 2 years ago

update: to use tp-native on mobile as of now you can replace it with utp-native-nodejs-mobile

Tried to use utp-native-nodejs-mobile. But still not building. Did it work for you?

freddi301 commented 2 years ago

update: to use tp-native on mobile as of now you can replace it with utp-native-nodejs-mobile

Tried to use utp-native-nodejs-mobile. But still not building. Did it work for you?

Made it work. Compilation works only on Linux. You need to run GenerateNativeNodeNativeAssetsList gradle command. Apply this patch https://github.com/nodejs-mobile/nodejs-mobile-react-native/issues/11 Have all tools for native compilation installed.

manashathparia commented 2 years ago

thanks got the native deps recognised. now getting another error while building the deps.

npm ERR! make: *** No rule to make target 'Release/obj.target/libutp/deps/libutp/utp_internal.o', needed by 'Release/utp.a'. Stop. npm ERR! gyp ERR! build error npm ERR! gyp ERR! stack Error: 'make' failed with exit code: 2