Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

7 duplicate symbols for architecture x86_64 in react native

when I am trying to run my react native app on the ios simulator I am getting this error.

Error:

duplicate symbol '_EXCanAskAgain' in:
    /Users/harshmishra/Library/Developer/Xcode/DerivedData/myways-gkjarpvjrufpitdstvqcnasxhmrs/Build/Products/Debug-iphonesimulator/EXPermissions/libEXPermissions.a(EXPermissions.o)
    /Users/harshmishra/Library/Developer/Xcode/DerivedData/myways-gkjarpvjrufpitdstvqcnasxhmrs/Build/Products/Debug-iphonesimulator/XCFrameworkIntermediates/UMReactNativeAdapter/UMReactNativeAdapter.framework/UMReactNativeAdapter(EXPermissionsService.o)
duplicate symbol '_EXExpiresKey' in:
    /Users/harshmishra/Library/Developer/Xcode/DerivedData/myways-gkjarpvjrufpitdstvqcnasxhmrs/Build/Products/Debug-iphonesimulator/EXPermissions/libEXPermissions.a(EXPermissions.o)
    /Users/harshmishra/Library/Developer/Xcode/DerivedData/myways-gkjarpvjrufpitdstvqcnasxhmrs/Build/Products/Debug-iphonesimulator/XCFrameworkIntermediates/UMReactNativeAdapter/UMReactNativeAdapter.framework/UMReactNativeAdapter(EXPermissionsService.o)
duplicate symbol '_EXGrantedKey' in:
    /Users/harshmishra/Library/Developer/Xcode/DerivedData/myways-gkjarpvjrufpitdstvqcnasxhmrs/Build/Products/Debug-iphonesimulator/EXPermissions/libEXPermissions.a(EXPermissions.o)
    /Users/harshmishra/Library/Developer/Xcode/DerivedData/myways-gkjarpvjrufpitdstvqcnasxhmrs/Build/Products/Debug-iphonesimulator/XCFrameworkIntermediates/UMReactNativeAdapter/UMReactNativeAdapter.framework/UMReactNativeAdapter(EXPermissionsService.o)
duplicate symbol '_EXPermissionExpiresNever' in:
    /Users/harshmishra/Library/Developer/Xcode/DerivedData/myways-gkjarpvjrufpitdstvqcnasxhmrs/Build/Products/Debug-iphonesimulator/EXPermissions/libEXPermissions.a(EXPermissions.o)
    /Users/harshmishra/Library/Developer/Xcode/DerivedData/myways-gkjarpvjrufpitdstvqcnasxhmrs/Build/Products/Debug-iphonesimulator/XCFrameworkIntermediates/UMReactNativeAdapter/UMReactNativeAdapter.framework/UMReactNativeAdapter(EXPermissionsService.o)
duplicate symbol '_EXStatusKey' in:
    /Users/harshmishra/Library/Developer/Xcode/DerivedData/myways-gkjarpvjrufpitdstvqcnasxhmrs/Build/Products/Debug-iphonesimulator/EXPermissions/libEXPermissions.a(EXPermissions.o)
    /Users/harshmishra/Library/Developer/Xcode/DerivedData/myways-gkjarpvjrufpitdstvqcnasxhmrs/Build/Products/Debug-iphonesimulator/XCFrameworkIntermediates/UMReactNativeAdapter/UMReactNativeAdapter.framework/UMReactNativeAdapter(EXPermissionsService.o)
duplicate symbol '_OBJC_CLASS_$_EXReactNativeUserNotificationCenterProxy' in:
    /Users/harshmishra/Library/Developer/Xcode/DerivedData/myways-gkjarpvjrufpitdstvqcnasxhmrs/Build/Products/Debug-iphonesimulator/EXPermissions/libEXPermissions.a(EXReactNativeUserNotificationCenterProxy.o)
    /Users/harshmishra/Library/Developer/Xcode/DerivedData/myways-gkjarpvjrufpitdstvqcnasxhmrs/Build/Products/Debug-iphonesimulator/XCFrameworkIntermediates/UMReactNativeAdapter/UMReactNativeAdapter.framework/UMReactNativeAdapter(EXReactNativeUserNotificationCenterProxy.o)
duplicate symbol '_OBJC_METACLASS_$_EXReactNativeUserNotificationCenterProxy' in:
    /Users/harshmishra/Library/Developer/Xcode/DerivedData/myways-gkjarpvjrufpitdstvqcnasxhmrs/Build/Products/Debug-iphonesimulator/EXPermissions/libEXPermissions.a(EXReactNativeUserNotificationCenterProxy.o)
    /Users/harshmishra/Library/Developer/Xcode/DerivedData/myways-gkjarpvjrufpitdstvqcnasxhmrs/Build/Products/Debug-iphonesimulator/XCFrameworkIntermediates/UMReactNativeAdapter/UMReactNativeAdapter.framework/UMReactNativeAdapter(EXReactNativeUserNotificationCenterProxy.o)
ld: 7 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I have tried cleaning the build folder, running pod install again but nothing works out. I am stuck on this error. I am not able to find what's causing this error. Also, I have checked myApp > Libraries folder there is nothing(empty folder).

like image 907
Harsh Mishra Avatar asked Aug 11 '21 13:08

Harsh Mishra


2 Answers

I had exactly the same error after adding react-native-unimodules library to the app I am working on.

After several hours of trying different solutions we were able to fix the error by downgrading the react-native-unimodules library from the current 0.14.7 version to 0.13.3.

  • changed the react-native-unimodules version in package.json
  • reinstalled the packages (yarn install for me)
  • cd ios, then pod deintegrate (just to be sure), then pod install
  • in XCode went to Product tab and Clean Build Folder from there
  • launched the app and it compiled successfully

Hope it helps anyone else who encounters the issue.

like image 197
Dmitry Petrov Avatar answered Sep 17 '22 22:09

Dmitry Petrov


The expo-permissions in the react-native-unimodules library 0.14.7 is outdated which caused the 7 duplicate symbols for architecture x86_64 in react native issue when you build the app. To fix this issue, you need to

  • run npm install expo-permissions
  • run pod install in ios folder
  • build and run iOS app again
like image 38
Robert Loh Avatar answered Sep 21 '22 22:09

Robert Loh