Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Mike James
    @export-mike
    hey? whats the latest on moving away from chakra core?
    also bitcode enabled on ios to reduce the app bundle size?
    adonnini
    @adonnini
    @frank-dspeed what you propose sounds interesting and, from the looks of it, it makes sense. Do you have a sense of how big a project this would be in terms of person days? Would the implementation of what you propose be transparent to apps using nodejs-mobile? Thanks
    Jaime Bernardo
    @jaimecbernardo
    Hi @adonnini ,
    How are these .env files normally used?
    I think they are not part of core Node.js.
    If they are used through a module I suppose trying those modules would be the way to go.
    You might also be able to use the native way for setting enviroment variables on each platform.
    Jaime Bernardo
    @jaimecbernardo
    Hi @frank-dspeed,
    That could be interesting, but users seem to expect that the V8 engine is used underneath. Before we used to have chakracore on iOS and it was requested that V8 was used for iOS as well, with the expectation that this would make modules that you'd use on a server part of the code more compatible with mobile code.
    The current plan is to keep using official Node.js as the base repo, for better future compatibility with modules.
    There's also some effort put into having the engine start as soon as possible, as app load times were a concern in earlier versions, and the official Node.js - V8 pairing seems to do a good job at this.
    What benefits would you say switching to graal brings?
    Anyway, should you be able to build a libnode.so and a set of compatible headers for native modules, I suppose those could be used interchangeably with current binaries.
    Hi @export-mike,
    nodejs-mobile now uses V8 in both Android and iOS.
    There are no plans for bitcode on iOS currently.
    This would be a welcome contribution, though.
    Alejandro Reimondo
    @aleReimondo
    Hi @all,
    I have been using nodejs-mobile in S8 Smalltalk platform running on android devices witgout any problems for long time.
    Recently I implemented tello dhrone interface that uses dgram socket (client & server) to connect to the dhrone and listen for results and data.
    The code works OK running on top of node.js on windows desktop; but when I run the same on nodejs-mobile, the (upd4) socket instances are created and bound but NO message is received and also no error report.
    Does someone know a reason why it can happen running in the android device?
    Any recommendation or guidance to find the issue will be realy appreciated.
    kind regards,
    adonnini
    @adonnini
    @jaimecbernardo .env files are normally used in nodejs server based applications to store system wide constants (environment variables). There is an extension called dotenv to support the use of .env files. However, it does not work on mobile devices.
    JeremyConnor
    @JeremyConnor
    I have been recently trying to use nodejs-mobile for my react native app, but I am facing an error when running react-native run-android. The error is
    FAILURE: Build failed with an exception.
    What went wrong:
    Execution failed for task ':nodejs-mobile-react-native:MakeToolchainarm64-v8a'.
    > Process 'command '/home/manul/Android/android-ndk-r21b/build/tools/make-standalone-toolchain.sh'' finished with non-zero exit value 1
    Frank Lemanschik
    @frank-dspeed
    you need to run the command directly
    and post that error
    so we know why it ended with 1
    sounds logical doesn't it?
    JeremyConnor
    @JeremyConnor
    Yup, that's very logical and that's the reason I had posted an issue on Github repository of nodejs-mobile 1 or 2 days ago.
    For your reference, here is the link JaneaSystems/nodejs-mobile#293
    Kloak
    @KloakIT
    I think that have not include the 64 bit binaries.
    janeasystems/nodejs-mobile#130
    This is what I give up to use nodejs-mobile for react native, It is working when build nodejs-mobile for Android.
    hector
    @hectorqin
    Hi, everybody! Is there any body knows that how to run npm or yarn command on android mobile?
    Frank Lemanschik
    @frank-dspeed
    hector you can not do that in a regular way
    Kloak
    @KloakIT
    Hi @hectorqin, you may install terminal for Android to install nodeJS and Yarn.
    Alonew0lfxx
    @Alonew0lfxx

    Hello everyone! I am a Java Android application developer and I decided to learn React-Native. However, I have a problem.

    https://ibb.co/JcsXgCb
    When I run the command nodejs.start ('main.js') in the image above, my react-native app closes (in android emu.), I cannot learn what I did wrong because the application closes without giving me any type of error output...
    I would be glad if you help me!

    Thank you!
    Emirhan Kolver

    I completed the steps one by one in https://code.janeasystems.com/nodejs-mobile/getting-started-react-native and I can't find the thing that escaped my eyes
    Alonew0lfxx
    @Alonew0lfxx

    Hello everyone! I am a Java Android application developer and I decided to learn React-Native. However, I have a problem.

    https://ibb.co/JcsXgCb
    When I run the command nodejs.start ('main.js') in the image above, my react-native app closes (in android emu.), I cannot learn what I did wrong because the application closes without giving me any type of error output...
    I would be glad if you help me!

    Thank you!
    Emirhan Kolver

    I fixed this issue with downgrading react-native version from latest to 0.61.5, have a nice holiday!

    hector
    @hectorqin
    thanks,i've fixed this problem
    Reto Gmür
    @retog

    Hello, I have been running my app successfully in node on Termux. However, with nodejs-mobile it crashes with the message

    E/nodejs: os.js:63 throw new ERR_SYSTEM_ERROR(ctx); ^ SystemError [ERR_SYSTEM_ERROR]: A system error occurred: uv_interface_addresses returned Unknown system error 13 (Unknown system error 13) at Object.networkInterfaces (os.js:205:16)

    the node version on Termux is newer than the one in nodejs-mobile, so I'm not sure if the problem will disappear when node 14.4. comes to nodejs-mobile. But any suggestion on how to address this issue would be very welcome!

    Reto Gmür
    @retog
    I've tried with node 12.18.3 on Termux, there my app works as well. So that just waiting for a newer node version in nodejs-mobile probably wouldn't solve the problem.
    Peter Stakoun
    @pstakoun
    Hi all, does anyone have any pointers getting Realm to work with nodejs-mobile in a React Native project? I'm currently getting an Undefined symbols for architecture x86_64 error.
    Peter Stakoun
    @pstakoun
    When I add the BUILD_NATIVE_MODULES.txt file with value "0", I get this error when requiring realm in node {"code":"MODULE_NOT_FOUND","requireStack":["/Users/peter/Library/Developer/CoreSimulator/Devices/49BDE201-BBE1-4986-9227-13B4A6AAE0AD/data/Containers/Bundle/Application/F4FF317F-BB7B-4C9B-B7BF-5C7B5390A251/Gradient.app/nodejs-project/node_modules/realm/lib/index.js","/Users/peter/Library/Developer/CoreSimulator/Devices/49BDE201-BBE1-4986-9227-13B4A6AAE0AD/data/Containers/Bundle/Application/F4FF317F-BB7B-4C9B-B7BF-5C7B5390A251/Gradient.app/nodejs-project/main.js"]}. I checked the node_modules in the project and the device and the index.js file is there.
    Nico Thomaier
    @semidark

    Hi,

    Hello, I have been running my app successfully in node on Termux. However, with nodejs-mobile it crashes with the message

    E/nodejs: os.js:63 throw new ERR_SYSTEM_ERROR(ctx); ^ SystemError [ERR_SYSTEM_ERROR]: A system error occurred: uv_interface_addresses returned Unknown system error 13 (Unknown system error 13) at Object.networkInterfaces (os.js:205:16)

    the node version on Termux is newer than the one in nodejs-mobile, so I'm not sure if the problem will disappear when node 14.4. comes to nodejs-mobile. But any suggestion on how to address this issue would be very welcome!

    I'm facing the same Problem as @Retog a while ago. Does anybody have an idea how to solve this?

    2 replies
    adonnini
    @adonnini

    @jaimecbernardo Hi, My app just failed with the following error:

    Fatal error in , line 0

    API fatal error handler returned after process out of memory
    #

    in a mobile environment, the solution below does not work as there are no user settable environment variables/file
    export NODE_OPTIONS=--max_old_space_size=4096

    Would calling node with the command line (from my MainActivity.java) work?

    startNodeWithArguments(new String[]{"node","--max-old-space-size=4096", nodeDir+"/main.js"});

    Nico Thomaier
    @semidark
    Here os a Thread on github discussing environment variables https://github.com/janeasystems/nodejs-mobile/issues/72#issuecomment-391384613
    adonnini
    @adonnini
    @semidark Thanks for your suggestion. setenv does not work on Android. I tried another add-on, dotenv, which has similar functionality. It does not work on Android either. The problem is that on Android .env files are not accessible to applications.
    The good news is that adding to the argument list for startNodeWithArguments works (at least it appears to work).
    I would still like confirmation from @jaimecbernardo that chaning the startNodeWithArguments argument list does work.
    Thanks for your help
    5 replies
    oliveirapedroma
    @oliveirapedroma
    Hi! I'm migrating an existing app that currently is seperated, an .apk and a nodejs app running on termux. I'm following the quick example from: https://code.janeasystems.com/nodejs-mobile/getting-started-cordova but i'm getting the error E/NODEJS-MOBILE: Error: Cannot find module 'cordova-bridge' can anybody help me?
    32 replies
    Connor Davis
    @connor-davis

    Execution failed for task ':nodejs-mobile-react-native:BuildNpmModulesarm64-v8a'.

    Process 'command 'npm'' finished with non-zero exit value 1

    How can I sort this out?
    Nico Thomaier
    @semidark

    Hi, I'm trying to get native node modules to work with my Corova Project, but currently I'm failing badly. I see there are a few Issues for this and i opend up one myself.

    Has anyone a working setup to cross compile node modules that have native code like the sqlite3 module?

    Mike James
    @export-mike

    Anyone had issues with bundling sqlite3? node-sqlite3 yarn add sqlite3

    @semidark sounds like you are trying todo the same thing?

    So the app has been working like this now for over a year. and since I updated to use the new API keys to upload to appstore connect it appears to be more restrictive in the upload?

    "Invalid Bundle Structure - The binary file 'myapp.app/nodejs-project/node_modules/sqlite3/lib/binding/node_abi-platform-arch/node_sqlite3.node' is not permitted. Your app can’t contain standalone executables or libraries, other than a valid CFBundleExecutable of supported bundles. Refer to the Bundle Programming Guide at https://developer.apple.com/go/?id=bundle-structure for information on the iOS app bundle structure."

    If I remove that file node_sqlite3.node my app doesn't run as the nodejs project requires sqlite3...
    Mike James
    @export-mike

    Interesting Development

    If I upload the ipa via the organizer in XCode I do not get the Invalid Binary Structure and I can confirm the .node file exists in the IPA, but if you upload using the new appstoreconnect API key you will encounter the Invalid bundle structure error?

    so I'm now confused if I need to remove these .node files.
    I think they are needed as its the sqlite binary
    Nico Thomaier
    @semidark

    Yeah, trying to do a similar thing on Android but failing even to build the .node files. I think the .node files are the cross compiled binaries that nodejs-mobile library loads. I guess you cant remove them without loosing the functionality of the the node package.

    I was thinking about using a wasm version of the sqlite code, so i don't need to crosscompile the c++ code. Since I don't need sqlite that badly, this was just an Idea for the future: https://www.npmjs.com/package/sqlite-wasm

    Forest Plasencia
    @ForestP
    Hello has anyone has any luck getting ipfs running on rn 60+ ? I found some threads from a couple years back, but none addressing the error im seeing with the bcrypto: bcrypto@5.4.0 install:node-gyp rebuild`` whenever i build in xcode. please let me know if anyone knows whats going on with this.
    @jaimecbernardo not sure if youre still around but would love to chat and see how you got it working
    Mike James
    @export-mike
    Right @semidark this is a bit of a problem for us then as we have been deploying this app for over a year now with sqlite bundled, with no issues and now we're starting to see invalid binary structure on upload to testflight. any ideas on how I can compile it so apple will accept it? @jaimecbernardo
    Jaime Bernardo
    @jaimecbernardo
    Hi,
    I've been a bit more absent indeed.
    I don't think I ever trying to get ipfs or bcrypto working myself.
    @export-mike , .node is a shared library, which will be detected and rejected by Apple. the method for dynamic libraries in the plugins should be trying to convert to a framework and deleting every .node when building. Not sure why you're still seeing .node files.
    Mike James
    @export-mike
    right! thanks @jaimecbernardo, so what do I need to look into converting my .node file to framework? this makes sense!
    Jaime Bernardo
    @jaimecbernardo
    The module's are supposed to add some script phases to the iOS build in order for them to run when building the iOS application. For example, the react-native plugin has this extra build phases configured here: https://github.com/JaneaSystems/nodejs-mobile-react-native/blob/17fe8f26b6d253b2eec648efcf086aaae0cbc078/react-native.config.js
    These scripts are in the plugin's ./scripts path and use nodejs-mobile-gyp, which is capable of building .frameworks: https://github.com/JaneaSystems/nodejs-mobile-react-native/blob/17fe8f26b6d253b2eec648efcf086aaae0cbc078/scripts/ios-build-native-modules.sh#L39-L43
    Mike James
    @export-mike
    right thanks, so its almost like this isn't being picked up in glob or something (guess at this point)