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

Expo-managed react native "eject" (or prebuild) build error (duplicate symbols) #1381

Closed
aureat opened this issue Apr 30, 2024 · 6 comments · Fixed by #1401
Closed

Expo-managed react native "eject" (or prebuild) build error (duplicate symbols) #1381

aureat opened this issue Apr 30, 2024 · 6 comments · Fixed by #1401
Assignees
Labels
bug Something isn't working pinned don't close this just for being stale work-in-progress

Comments

@aureat
Copy link

aureat commented Apr 30, 2024

Bug
When you run on a physical device with expo run:ios, the error says ld: 12 duplicate symbols.

To Reproduce
Steps to reproduce the behaviour:

  1. Follow the exact same steps from the official React Native Tutorial
    https://veramo.io/docs/react_native_tutorials/react_native_1_setup_identifiers
  2. Run npx expo prebuild --platform ios
  3. Change deployment target to > iOS 13.4
  4. Run npx expo run:ios --device, run on a physical device

Observed behaviour
All of the build phases go through as below:

› Executing expo-random Pods/ExpoRandom » Copy generated compatibility header
› Compiling Pods/Pods-VaulletMobile » Pods-VaulletMobile-dummy.m
› Packaging Pods/Pods-VaulletMobile » libPods-VaulletMobile.a
› Executing VaulletMobile » [CP] Check Pods Manifest.lock
› Executing VaulletMobile » Start Packager on http://localhost:8081
› Executing VaulletMobile » [Expo] Configure project
› Copying   ios/VaulletMobile/Supporting/Expo.plist ➜ ./Expo.plist
› Compiling VaulletMobile » SplashScreen.storyboard
› Compiling VaulletMobile » main.m
› Compiling VaulletMobile » VaulletMobile_vers.c
› Compiling VaulletMobile » AppDelegate.mm
› Preparing VaulletMobile » Info.plist
› Linking   VaulletMobile » VaulletMobile

Until in the last phase it results in a build error with ld: 12 duplicate symbols.

Expected behaviour
I have tested veramo with another expo-managed react native project, it worked, compiled, and ran perfectly. This error started popping up within the last 48-72 hours.

Details

❌  duplicate symbol '_EXExpiresKey' in
┌─ libExpoModulesCore.a[23](EXPermissionsService.o)
└─ UMReactNativeAdapter[3](EXPermissionsService.o)

❌  duplicate symbol '_EXGrantedKey' in
┌─ libExpoModulesCore.a[23](EXPermissionsService.o)
└─ UMReactNativeAdapter[3](EXPermissionsService.o)

❌  duplicate symbol '_OBJC_CLASS_$_EXReactNativeUserNotificationCenterProxy' in
┌─ libExpoModulesCore.a[35](EXReactNativeUserNotificationCenterProxy.o)
└─ UMReactNativeAdapter[4](EXReactNativeUserNotificationCenterProxy.o)

❌  duplicate symbol '_OBJC_IVAR_$_EXPermissionsService._requesters' in
┌─ libExpoModulesCore.a[23](EXPermissionsService.o)
└─ UMReactNativeAdapter[3](EXPermissionsService.o)

❌  duplicate symbol '_OBJC_IVAR_$_EXPermissionsService._requestersByClass' in
┌─ libExpoModulesCore.a[23](EXPermissionsService.o)
└─ UMReactNativeAdapter[3](EXPermissionsService.o)

❌  duplicate symbol '_EXStatusKey' in
┌─ libExpoModulesCore.a[23](EXPermissionsService.o)
└─ UMReactNativeAdapter[3](EXPermissionsService.o)

❌  duplicate symbol '_OBJC_IVAR_$_EXPermissionsService._moduleRegistry' in
┌─ libExpoModulesCore.a[23](EXPermissionsService.o)
└─ UMReactNativeAdapter[3](EXPermissionsService.o)

❌  duplicate symbol '_EXCanAskAgain' in
┌─ libExpoModulesCore.a[23](EXPermissionsService.o)
└─ UMReactNativeAdapter[3](EXPermissionsService.o)

❌  duplicate symbol '_OBJC_METACLASS_$_EXPermissionsService' in
┌─ libExpoModulesCore.a[23](EXPermissionsService.o)
└─ UMReactNativeAdapter[3](EXPermissionsService.o)

❌  duplicate symbol '_OBJC_METACLASS_$_EXReactNativeUserNotificationCenterProxy' in
┌─ libExpoModulesCore.a[35](EXReactNativeUserNotificationCenterProxy.o)
└─ UMReactNativeAdapter[4](EXReactNativeUserNotificationCenterProxy.o)

❌  duplicate symbol '_EXPermissionExpiresNever' in
┌─ libExpoModulesCore.a[23](EXPermissionsService.o)
└─ UMReactNativeAdapter[3](EXPermissionsService.o)

❌  duplicate symbol '_OBJC_CLASS_$_EXPermissionsService' in
┌─ libExpoModulesCore.a[23](EXPermissionsService.o)
└─ UMReactNativeAdapter[3](EXPermissionsService.o)


❌  ld: 12 duplicate symbols



❌  clang: error: linker command failed with exit code 1 (use -v to see invocation)


⚠️  Script has ambiguous dependencies causing it to run on every build.
   To fix, go to: Xcode » VaulletMobile/VaulletMobile » Build Phases » 'Start Packager'
   Either: Uncheck "Based on dependency analysis", or select output files to trigger the script

⚠️  Script has ambiguous dependencies causing it to run on every build.
   To fix, go to: Xcode » VaulletMobile/VaulletMobile » Build Phases » 'Bundle React Native code and images'
   Either: Uncheck "Based on dependency analysis", or select output files to trigger the script


› 14 error(s), and 3 warning(s)

CommandError: Failed to build iOS project. "xcodebuild" exited with error code 65.

Versions:
Exact versions as the official react native guide and the react native tutorial repository:
https://veramo.io/docs/react_native_tutorials/react_native_1_setup_identifiers
https://github.com/veramolabs/veramo-react-native-tutorial/blob/main/package.json

  • Veramo: 6.0.0
  • Expo: 49.0.15
@aureat aureat added the bug Something isn't working label Apr 30, 2024
@aureat
Copy link
Author

aureat commented Apr 30, 2024

expo/expo#15648

@aureat
Copy link
Author

aureat commented Apr 30, 2024

Update
The duplicate symbols are coming from @unimodules/react-native-adapter, depended on by isomorphic-webcrypto.
Here's the appropriate code from my package-lock.json:

    "node_modules/isomorphic-webcrypto": {
      "version": "2.3.8",
      "resolved": "https://registry.npmjs.org/isomorphic-webcrypto/-/isomorphic-webcrypto-2.3.8.tgz",
      "integrity": "sha512-XddQSI0WYlSCjxtm1AI8kWQOulf7hAN3k3DclF1sxDJZqOe0pcsOt675zvWW91cZH9hYs3nlA3Ev8QK5i80SxQ==",
      "optional": true,
      "dependencies": {
        "@peculiar/webcrypto": "^1.0.22",
        "asmcrypto.js": "^0.22.0",
        "b64-lite": "^1.3.1",
        "b64u-lite": "^1.0.1",
        "msrcrypto": "^1.5.6",
        "str2buf": "^1.3.0",
        "webcrypto-shim": "^0.1.4"
      },
      "optionalDependencies": {
        "@unimodules/core": "*",
        "@unimodules/react-native-adapter": "*",
        "expo-random": "*",
        "react-native-securerandom": "^0.1.1"
      }
    },

@vadimchilinciuc
Copy link

its possible to remove the dependecy of isomorphic-webcrypto in DidCom ? Cause its need to Migrate to Expo-Modules for Expo SDK 43 and newer, and not use unimodules-core but expo-modules instead.

@mirceanis
Copy link
Member

its possible to remove the dependecy of isomorphic-webcrypto in DidCom ? Cause its need to Migrate to Expo-Modules for Expo SDK 43 and newer, and not use unimodules-core but expo-modules instead.

sadly we can't remove isomorphic-webcrypto as we don't have an alternative yet

@mirceanis
Copy link
Member

@vadimchilinciuc @aureat maybe if enough people insist here: paulmillr/noble-ciphers#12 we could get a pure JS implementation.
I believe AESKW is the last algorithm for which we don't have multi-platform alternatives and that is a requirement in didcomm

@mirceanis mirceanis added the pinned don't close this just for being stale label Jun 27, 2024
@mirceanis mirceanis self-assigned this Jul 11, 2024
mirceanis added a commit that referenced this issue Jul 11, 2024
mirceanis added a commit that referenced this issue Jul 11, 2024
mirceanis added a commit that referenced this issue Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pinned don't close this just for being stale work-in-progress
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants