staltz / sodium-native-nodejs-mobile

Low level bindings for libsodium

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build native modules for Android armeabi-v7a and arm64-v8a

Lonmee opened this issue · comments

commented

error in ./gradlew BuildNpmModulesarmeabi-v7a

ld: error: ./.libs/libaesni.a(/): not an ELF file
clang-14: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [libsodium.la] Error 1
make[2]: *** [install-recursive] Error 1
make[1]: *** [install-recursive] Error 1
make: *** [install-recursive] Error 1
.../android/build/nodejs-native-assets-temp-build/nodejs-native-assets-armeabi-v7a/nodejs-project/node_modules/sodium-native-nodejs-mobile/preinstall.js:178
if (err) throw err
^

Error: ./dist-build/android-armv7-a.sh exited with 2
at ChildProcess. (.../android/build/nodejs-native-assets-temp-build/nodejs-native-assets-armeabi-v7a/nodejs-project/node_modules/sodium-native-nodejs-mobile/preinstall.js:220:25)
at ChildProcess.emit (node:events:513:28)
at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm info run sodium-native-nodejs-mobile@3.2.0-6 install { code: 1, signal: null }
npm timing command:rebuild Completed in 191367ms
npm verb stack Error: command failed
npm verb stack at ChildProcess. (....nvm/versions/node/v16.17.1/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:63:27)
npm verb stack at ChildProcess.emit (node:events:513:28)
npm verb stack at maybeClose (node:internal/child_process:1093:16)
npm verb stack at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
npm verb pkgid sodium-native-nodejs-mobile@3.2.0-6
npm verb cwd .../android/build/nodejs-native-assets-temp-build/nodejs-native-assets-armeabi-v7a/nodejs-project
npm verb Darwin 22.4.0
npm verb node v16.17.1
npm verb npm v8.15.0
npm ERR! code 1
npm ERR! path.../android/build/nodejs-native-assets-temp-build/nodejs-native-assets-armeabi-v7a/nodejs-project/node_modules/sodium-native-nodejs-mobile
npm ERR! command failed
npm ERR! command sh /var/folders/j0/gntt7nds3fx3dw47r34yh8100000gn/T/install-30d183f2.sh
npm verb exit 1

and ./gradlew BuildNpmModulesarm64-v8a is OK.

seems in preinstall
spawn('./dist-build/' + buildScript, [], { cwd: path.resolve(__dirname, 'libsodium'), stdio: 'inherit', env: {...process.env, LIBSODIUM_FULL_BUILD: 'yes'} }, function (err) {
if (err) throw err