Assets copy produces Gbytes of files and return
sallespro opened this issue · comments
the quest to libsodium-nodejs-mobile faces strange issues.
native modules in general have been hard to use with nodejs-mobile and recent react-native releases.
i have looked at maniverse app to get some ideas.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:installDebug'.
> java.util.concurrent.ExecutionException: com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: INSTALL_FAILED_INSUFFICIENT_STORAGE
You have to delete most of the files in node_modules, except those ones that are the built dynamic libraries (.node
files)
maybe i'm almost there. it's very nice to have your help.
i deleted the extra files, mainly libsodium submodule. left only build/release
files
questions i have : do i need to copy the .so to android/app/src/main/jniLibs
?
2021-06-30 19:17:59.952 29352-29431/com.rnna E/nodejs: /data/data/com.rnna/files/nodejs-project/node_modules/bindings/bindings.js:121
throw e;
^
Error: dlopen failed: "/data/data/com.rnna/files/nodejs-project/node_modules/sodium-native-nodejs-mobile/build/Release/sodium.node" has bad ELF magic: cffaedfe
i suspect the target android API, or NDK version. During the compilation, i shows compiling for [android-16] and then [android-21] where do one sets this ? i'm using x86 emulator API 29 ( Android 10 ) to run.
WARNING:__main__:make_standalone_toolchain.py is no longer necessary. ...
Instead use:
$ $NDK/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android21-clang++ src.cpp
You have to copy libsodium over, i took inspiration from here https://gitlab.com/staltz/manyverse/-/blob/master/tools/backend/move-shared-libs-android.sh