Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in ios build #15

Open
valavanisleonidas opened this issue Dec 17, 2024 · 9 comments
Open

Error in ios build #15

valavanisleonidas opened this issue Dec 17, 2024 · 9 comments
Assignees

Comments

@valavanisleonidas
Copy link

Hello everyone,

I am using rapidsnark 0.0.1-alpha.5 version on M2 mac, xcode 15,4 version, react version 0.76.5.

On android i don't have any issues. On ios it crashes with error

Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'RNRapidsnark' could not be found. Verify that a module by this name is registered in the native binary.

any ideas on the issue? I also tried the PR 0.0.6 version but i get the same

Thank you very much

@5eeman 5eeman self-assigned this Dec 17, 2024
@5eeman
Copy link
Collaborator

5eeman commented Dec 17, 2024

Hey,
We already had similar issue, try renaming this constant to Rapidsnark locally
I'll try to create fix to this today, also with updated libraries included.

@valavanisleonidas
Copy link
Author

Hey,

thanks for the quick reply,

based on this comment I changed the name to Rapidsnark instead of RNRapidsnark but I get the same error. Is this the fix you were referring ?

Anyway it seems I will wait for the fix :)

@5eeman
Copy link
Collaborator

5eeman commented Dec 19, 2024

Hey,
Sorry for long wait
Please try using direct branch dependency with branch fix/example_turbo_modulesor main.

@valavanisleonidas
Copy link
Author

hey @5eeman

thank you so much for the fix. I have a newly created test project with version 0.76.5 and it works fine now with the branch.

I have another project that I am working on and wanting to integrate rapidsnark which is updated from 0.72.4 to 0.75.4 but the same code doesn't work. I use a webview to calculate the witness and then run rapidsnark but it crashes without error. I get only app quit unexpectedly.

The package.json on the project it doesn't work is

  "dependencies": {
    "@aries-framework/anoncreds": "0.5.0-alpha.60",
    "@aries-framework/anoncreds-rs": "0.5.0-alpha.60",
    "@aries-framework/askar": "0.5.0-alpha.60",
    "@aries-framework/core": "0.5.0-alpha.60",
    "@aries-framework/indy-vdr": "0.5.0-alpha.60",
    "@aries-framework/push-notifications": "0.6.0",
    "@aries-framework/react-hooks": "^0.5.0",
    "@aries-framework/react-native": "0.5.0-alpha.60",
    "@darkforest_eth/hashing": "^6.7.29",
    "@ethersproject/bytes": "^5.7.0",
    "@ethersproject/keccak256": "^5.7.0",
    "@ethersproject/shims": "^5.7.0",
    "@hyperledger/anoncreds-react-native": "0.2.0-dev.4",
    "@hyperledger/aries-askar-react-native": "0.2.0",
    "@hyperledger/indy-vdr-react-native": "0.2.0-dev.3",
    "@iden3/react-native-rapidsnark": "https://github.com/iden3/react-native-rapidsnark.git#fix/example_turbo_modules",
    "@ptomasroos/react-native-multi-slider": "^2.2.2",
    "@react-native-async-storage/async-storage": "^1.19.2",
    "@react-native-community/cli-doctor": "^11.3.9",
    "@react-native-community/clipboard": "^1.5.1",
    "@react-native-community/datetimepicker": "^7.5.0",
    "@react-native-community/masked-view": "^0.1.11",
    "@react-native-community/netinfo": "^11.3.0",
    "@react-navigation/bottom-tabs": "^6.5.8",
    "@react-navigation/native": "^6.1.7",
    "@react-navigation/native-stack": "^6.9.13",
    "@sentry/react-native": "^5.19.2",
    "@shopify/flash-list": "^1.4.3",
    "@testing-library/react-hooks": "^8.0.1",
    "@testing-library/react-native": "^12.3.0",
    "@twotalltotems/react-native-otp-input": "^1.3.11",
    "axios": "^1.6.6",
    "bn.js": "^5.2.1",
    "buffer": "^6.0.3",
    "elliptic": "^6.6.1",
    "ethers": "^6.8.1",
    "moment": "^2.29.4",
    "moment-timezone": "^0.5.43",
    "nodejs-mobile-react-native": "^18.20.4",
    "patch-package": "^7.0.0",
    "postinstall-postinstall": "^2.1.0",
    "react": "18.3.1",
    "react-native": "0.75.4",
    "react-native-actions-sheet": "^0.8.29",
    "react-native-biometrics": "^3.0.1",
    "react-native-blob-util": "^0.19.6",
    "react-native-countdown-component": "^2.7.1",
    "react-native-country-picker-modal": "^2.0.0",
    "react-native-device-info": "^10.6.0",
    "react-native-element-dropdown": "^2.10.0",
    "react-native-fs": "^2.20.0",
    "react-native-gesture-handler": "^2.15.0",
    "react-native-get-random-values": "^1.10.0",
    "react-native-image-crop-picker": "^0.40.0",
    "react-native-image-picker": "^5.6.1",
    "react-native-image-slider-box": "^2.0.7",
    "react-native-localization": "^2.3.1",
    "react-native-localize": "^3.0.2",
    "react-native-modal-datetime-picker": "^17.1.0",
    "react-native-notifier": "^1.9.0",
    "react-native-onesignal": "^5.0.6",
    "react-native-progress": "5.0.1",
    "react-native-qrcode-svg": "^6.3.0",
    "react-native-quick-base64": "^2.0.8",
    "react-native-randombytes": "^3.6.1",
    "react-native-responsive-linechart": "^5.7.1",
    "react-native-safe-area-context": "^4.6.3",
    "react-native-screens": "^3.20.0",
    "react-native-sha256": "^1.4.10",
    "react-native-signature-canvas": "^4.6.1",
    "react-native-splash-screen": "^3.3.0",
    "react-native-svg": "^14.1.0",
    "react-native-tab-view": "^3.5.2",
    "react-native-vector-icons": "^10.0.0",
    "react-native-version-check": "^3.4.7",
    "react-native-video": "^5.2.1",
    "react-native-walkthrough-tooltip": "^1.5.0",
    "react-native-webassembly": "^0.3.3",
    "react-native-webview": "^13.12.5",
    "react-redux": "^8.1.1",
    "redux": "^4.2.1",
    "redux-mock-store": "^1.5.4",
    "redux-thunk": "^2.4.2",
    "uuid": "^9.0.1",
    "victory-native": "^36.6.11"
  },
  "devDependencies": {
    "@babel/core": "^7.25.2",
    "@babel/plugin-transform-private-methods": "^7.25.9",
    "@babel/preset-env": "^7.25.3",
    "@babel/runtime": "^7.25.0",
    "@react-native-community/cli": "15.0.1",
    "@react-native-community/cli-platform-android": "15.0.1",
    "@react-native-community/cli-platform-ios": "15.0.1",
    "@react-native/babel-preset": "0.75.4",
    "@react-native/eslint-config": "0.75.4",
    "@react-native/metro-config": "0.75.4",
    "@react-native/typescript-config": "0.75.4",
    "@testing-library/jest-dom": "^6.1.4",
    "@tsconfig/react-native": "^3.0.0",
    "@types/jest": "^29.5.6",
    "@types/lodash": "^4.14.202",
    "@types/react": "^18.0.24",
    "@types/react-native-vector-icons": "^6.4.17",
    "@types/react-test-renderer": "^18.0.0",
    "@types/redux-mock-store": "^1.0.5",
    "babel-jest": "^29.2.1",
    "babel-plugin-module-resolver": "^5.0.0",
    "eslint": "^8.19.0",
    "jest": "^29.2.1",
    "metro-react-native-babel-preset": "^0.77.0",
    "prettier": "^2.4.1",
    "react-native-builder-bob": "^0.35.2",
    "react-native-svg-transformer": "^1.5.0",
    "react-test-renderer": "18.3.1",
    "typescript": "5.0.4"
  },
  "engines": {
    "node": ">=18"
  }

I have no idea about the error but i suspect one of these libraries interfere? or the RN version ? any idea how to debug further ?

Thanks a lot again for the support and help.
This project is awesome :)

@5eeman
Copy link
Collaborator

5eeman commented Dec 19, 2024

Lil spoiler - I'm gonna create first alpha version of witness calc RN lib this week. We already have iOS and Android versions.
Have no idea what is going wrong with your project atm.
I'll try make more predictable error handling on iOS side, I'll ping here once it is ready.

@valavanisleonidas
Copy link
Author

ooo sounds awesome. please share the RN witness lib as well :)

@5eeman
Copy link
Collaborator

5eeman commented Dec 19, 2024

Here are couple things that might help us debug:

  1. Try launch app from XCode to get more detailed output stacktrace. This one is the most promisable 😅
  2. If you're using groth16ProveWithZKeyFilePath, try groth16Prove to check that issue is not path related and vice versa just in case.
  3. Maybe also try with other circuit, I've bundled authV2 circuit there and you can find some test inputs for it here.
  4. Reproducible example would be awesome, but I understand how much time that might take.

@valavanisleonidas
Copy link
Author

@5eeman it seems it worked and solved my issue. something else must have been wrong with my project but its weird it was crashing at that part.

I am still very interested and excited in the React native witness calculation lib since I am running in a webview currently :)

@5eeman
Copy link
Collaborator

5eeman commented Dec 23, 2024

@valavanisleonidas
Made it public, you can use main now.
https://github.com/iden3/react-native-circom-witnesscalc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants