Cannot build React Native project

I don't know why, but every time I try to build, I get these "duplicate symbols for architecture x86_64" errors.

They have nothing to do with my code, they're just unexplained obstacles that hinder my productivity and waste my time for no reason whatsoever...

And to be honest I'm just tired of wasting my time trying to fix them.

So if there's anyone out there who knows how to fix this, thanks in advance.

duplicate symbol '_FBLPromiseRetryDefaultDelayInterval' in:
    /Users/mike-h/Library/Developer/Xcode/DerivedData/lbcfidelmobile-bnxskcnuyolvodbrlgoqclkwrtka/Build/Products/Debug-iphonesimulator/PromisesObjC/libPromisesObjC.a(FBLPromise+Retry 2.o)
    /Users/mike-h/Library/Developer/Xcode/DerivedData/lbcfidelmobile-bnxskcnuyolvodbrlgoqclkwrtka/Build/Products/Debug-iphonesimulator/PromisesObjC/libPromisesObjC.a(FBLPromise+Retry.o)
duplicate symbol '_FBLWaitForPromisesWithTimeout' in:
    /Users/mike-h/Library/Developer/Xcode/DerivedData/lbcfidelmobile-bnxskcnuyolvodbrlgoqclkwrtka/Build/Products/Debug-iphonesimulator/PromisesObjC/libPromisesObjC.a(FBLPromise+Testing 2.o)
    /Users/mike-h/Library/Developer/Xcode/DerivedData/lbcfidelmobile-bnxskcnuyolvodbrlgoqclkwrtka/Build/Products/Debug-iphonesimulator/PromisesObjC/libPromisesObjC.a(FBLPromise+Testing.o)
duplicate symbol '_OBJC_IVAR_$_FBLPromise._pendingObjects' in:
    /Users/mike-h/Library/Developer/Xcode/DerivedData/lbcfidelmobile-bnxskcnuyolvodbrlgoqclkwrtka/Build/Products/Debug-iphonesimulator/PromisesObjC/libPromisesObjC.a(FBLPromise 2.o)
    /Users/mike-h/Library/Developer/Xcode/DerivedData/lbcfidelmobile-bnxskcnuyolvodbrlgoqclkwrtka/Build/Products/Debug-iphonesimulator/PromisesObjC/libPromisesObjC.a(FBLPromise.o)
duplicate symbol '_OBJC_IVAR_$_FBLPromise._observers' in:
    /Users/mike-h/Library/Developer/Xcode/DerivedData/lbcfidelmobile-bnxskcnuyolvodbrlgoqclkwrtka/Build/Products/Debug-iphonesimulator/PromisesObjC/libPromisesObjC.a(FBLPromise 2.o)
    /Users/mike-h/Library/Developer/Xcode/DerivedData/lbcfidelmobile-bnxskcnuyolvodbrlgoqclkwrtka/Build/Products/Debug-iphonesimulator/PromisesObjC/libPromisesObjC.a(FBLPromise.o)
duplicate symbol '_OBJC_IVAR_$_FBLPromise._error' in:
    /Users/mike-h/Library/Developer/Xcode/DerivedData/lbcfidelmobile-bnxskcnuyolvodbrlgoqclkwrtka/Build/Products/Debug-iphonesimulator/PromisesObjC/libPromisesObjC.a(FBLPromise 2.o)
    /Users/mike-h/Library/Developer/Xcode/DerivedData/lbcfidelmobile-bnxskcnuyolvodbrlgoqclkwrtka/Build/Products/Debug-iphonesimulator/PromisesObjC/libPromisesObjC.a(FBLPromise.o)
duplicate symbol '_OBJC_IVAR_$_FBLPromise._value' in:
    /Users/mike-h/Library/Developer/Xcode/DerivedData/lbcfidelmobile-bnxskcnuyolvodbrlgoqclkwrtka/Build/Products/Debug-iphonesimulator/PromisesObjC/libPromisesObjC.a(FBLPromise 2.o)
    /Users/mike-h/Library/Developer/Xcode/DerivedData/lbcfidelmobile-bnxskcnuyolvodbrlgoqclkwrtka/Build/Products/Debug-iphonesimulator/PromisesObjC/libPromisesObjC.a(FBLPromise.o)
duplicate symbol '_OBJC_IVAR_$_FBLPromise._state' in:
    /Users/mike-h/Library/Developer/Xcode/DerivedData/lbcfidelmobile-bnxskcnuyolvodbrlgoqclkwrtka/Build/Products/Debug-iphonesimulator/PromisesObjC/libPromisesObjC.a(FBLPromise 2.o)
    /Users/mike-h/Library/Developer/Xcode/DerivedData/lbcfidelmobile-bnxskcnuyolvodbrlgoqclkwrtka/Build/Products/Debug-iphonesimulator/PromisesObjC/libPromisesObjC.a(FBLPromise.o)
duplicate symbol '_OBJC_CLASS_$_FBLPromise' in:
    /Users/mike-h/Library/Developer/Xcode/DerivedData/lbcfidelmobile-bnxskcnuyolvodbrlgoqclkwrtka/Build/Products/Debug-iphonesimulator/PromisesObjC/libPromisesObjC.a(FBLPromise 2.o)
    /Users/mike-h/Library/Developer/Xcode/DerivedData/lbcfidelmobile-bnxskcnuyolvodbrlgoqclkwrtka/Build/Products/Debug-iphonesimulator/PromisesObjC/libPromisesObjC.a(FBLPromise.o)
duplicate symbol '_OBJC_METACLASS_$_FBLPromise' in:
    /Users/mike-h/Library/Developer/Xcode/DerivedData/lbcfidelmobile-bnxskcnuyolvodbrlgoqclkwrtka/Build/Products/Debug-iphonesimulator/PromisesObjC/libPromisesObjC.a(FBLPromise 2.o)
    /Users/mike-h/Library/Developer/Xcode/DerivedData/lbcfidelmobile-bnxskcnuyolvodbrlgoqclkwrtka/Build/Products/Debug-iphonesimulator/PromisesObjC/libPromisesObjC.a(FBLPromise.o)
ld: 29 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

/Users/mike-h/Documents/dev/lbcfidelmobile/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.5.99. (in target 'Flipper-DoubleConversion' from project 'Pods')
/Users/mike-h/Documents/dev/lbcfidelmobile/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.5.99. (in target 'Flipper-Glog' from project 'Pods')
/Users/mike-h/Documents/dev/lbcfidelmobile/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.5.99. (in target 'boost-for-react-native' from project 'Pods')
/Users/mike-h/Documents/dev/lbcfidelmobile/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.4, but the range of supported deployment target versions is 9.0 to 14.5.99. (in target 'Flipper-PeerTalk' from project 'Pods')

objc[24816]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libauthinstall.dylib (0x1f1a26c10) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1143082c8). One of the two will be used. Which one is undefined.
objc[24816]: Class AMSupportURLSession is implemented in both /usr/lib/libauthinstall.dylib (0x1f1a26c60) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x114308318). One of the two will be used. Which one is undefined.
** BUILD FAILED **


The following build commands failed:
        Ld /Users/mike-h/Library/Developer/Xcode/DerivedData/lbcfidelmobile-bnxskcnuyolvodbrlgoqclkwrtka/Build/Products/Debug-iphonesimulator/lbcfidelmobile.app/lbcfidelmobile normal
(1 failure)

info Run CLI with --verbose flag for more details.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
The terminal process "zsh '-c', 'yarn run ios'" terminated with exit code: 1.
Answered by Mickael-H in 683474022

Yes. You need to run your Terminal with Rosetta (Get Info, then check the box), and then run your build command from there. If your Mac has an M1 chip and you want to do mobile development, you need to run pretty much every program with Rosetta, or you'll be swarmed by errors with every command.

hi, i have the same problem, i wonder if you got it fixed? What's the solution ?

Accepted Answer

Yes. You need to run your Terminal with Rosetta (Get Info, then check the box), and then run your build command from there. If your Mac has an M1 chip and you want to do mobile development, you need to run pretty much every program with Rosetta, or you'll be swarmed by errors with every command.

Cannot build React Native project
 
 
Q