Closed supersuryaansh closed 4 months ago
bare-crypto
builds just fine on Android, the issue is how it's integrated into Expo. ~Moving this issue.~ I don't seem to be able to transfer the issue, could you open a new one in https://github.com/holepunchto/pear-expo-hello-world? Thanks!
@kasperisager Can you tell me what do you mean by "how it's integrated into Expo" and what do I need to do to resolve this?
There's a bunch of outstanding issues in the Expo example repo and some PRs that fixes some of it. I'd start by looking into whether one of those fixes might do the trick.
@kasperisager I have compiled most of the PRs and fixed the expo-example in https://github.com/supersuryaansh/pear-expo-android-ios-app/.
Issues were related to links files and file paths, but this issue persists. It does not happen with any other module I have tried but this
As mentioned, the issue is linking as the BoringSSL symbols aren't included for some reason. It works fine in https://github.com/holepunchto/bare-android, I just ran this without issue:
console.log(require('bare-crypto').createHash('md5').update('Hello world!').digest('base64'))
@kasperisager Is there anything I can do to fix BoringSSL symbols?
Most likely! The first step would be figuring out why the BoringSSL libraries aren't included in the amalgamated archive. Try logging the dependency
variable here so see if ssl
and crypto
show up: https://github.com/holepunchto/cmake-bare/blob/91d6d176345dd9324794de0c61046c782ea71fed/bare.cmake#L414
I am using the pear-expo-hello-world example.
"bare-dev": "^0.11.3"
Trying to build for Android with command npx expo run:android --no-build-cache results in build failure and the following errors:
` › Building app... Configuration on demand is an incubating feature.
Using expo modules
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':hello-bare:buildCMakeDebug[arm64-v8a]'.
ld: error: undefined symbol: EVP_md5
ld: error: undefined symbol: EVP_sha256
ld: error: undefined symbol: EVP_sha512
ld: error: undefined symbol: EVP_sha1
ld: error: undefined symbol: EVP_DigestInit
ld: error: undefined symbol: EVP_MD_CTX_cleanup
ld: error: undefined symbol: EVP_DigestUpdate
ld: error: undefined symbol: EVP_MD_CTX_size
ld: error: undefined symbol: EVP_DigestFinal
ld: error: undefined symbol: RAND_bytes
C++ build system [build] failed while executing: /Users/supersu/Library/Android/sdk/cmake/3.22.1/bin/ninja \ -C \ /Users/supersu/Developer/holesail-go/modules/hello-bare/android/.cxx/Debug/2u6h4p5p/arm64-v8a \ hello_bare_jsi from /Users/supersu/Developer/holesail-go/modules/hello-bare/android
Try:
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
For more on this, please refer to https://docs.gradle.org/8.3/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
BUILD FAILED in 5s 271 actionable tasks: 11 executed, 260 up-to-date Error: /Users/supersu/Developer/holesail-go/android/gradlew exited with non-zero code: 1 Error: /Users/supersu/Developer/holesail-go/android/gradlew exited with non-zero code: 1 at ChildProcess.completionListener (/Users/supersu/Developer/holesail-go/node_modules/@expo/spawn-async/build/spawnAsync.js:52:23) at Object.onceWrapper (node:events:634:26) at ChildProcess.emit (node:events:519:28) at maybeClose (node:internal/child_process:1105:16) at ChildProcess._handle.onexit (node:internal/child_process:305:5) ... at Object.spawnAsync [as default] (/Users/supersu/Developer/holesail-go/node_modules/@expo/spawn-async/build/spawnAsync.js:17:21) at spawnGradleAsync (/Users/supersu/Developer/holesail-go/node_modules/@expo/cli/build/src/start/platforms/android/gradle.js:72:46) at Object.assembleAsync (/Users/supersu/Developer/holesail-go/node_modules/@expo/cli/build/src/start/platforms/android/gradle.js:52:18) at runAndroidAsync (/Users/supersu/Developer/holesail-go/node_modules/@expo/cli/build/src/run/android/runAndroidAsync.js:36:24) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) supersu@Suryaanshs-Laptop holesail-go % `
This does not happen on iOS but importing the module in iOS results in a white screen of death and nothing shows up in the app:
This is how I am trying to use it: const {createHash} = require('bare-crypto');