Home > Mobile >  Duplicate symbols for architecture arm64 - React-Native
Duplicate symbols for architecture arm64 - React-Native

Time:12-29

I'm trying to install vision-camera-code-scanner in my react-native project, in Android it works pretty well but in iOS I'm getting duplicate symbols error when I try to compile in Xcode:

duplicate symbol 'OBJC_CLASS$_GDTCCTCompressionHelper' in: /Users/XXXX/Library/Developer/Xcode/DerivedData/XXXX-cnkurxntfojncagfzgodwwoirogg/Build/Products/Debug-iphoneos/GoogleDataTransport.o /Users/XXXX/Library/Developer/Xcode/DerivedData/XXXX-cnkurxntfojncagfzgodwwoirogg/Build/Products/Debug-iphoneos/GoogleDataTransport/libGoogleDataTransport.a(GDTCCTCompressionHelper.o) duplicate symbol 'OBJC_METACLASS$_GDTCCTCompressionHelper' in: /Users/XXXX/Library/Developer/Xcode/DerivedData/XXXX-cnkurxntfojncagfzgodwwoirogg/Build/Products/Debug-iphoneos/GoogleDataTransport.o /Users/XXXX/Library/Developer/Xcode/DerivedData/XXXX-cnkurxntfojncagfzgodwwoirogg/Build/Products/Debug-iphoneos/GoogleDataTransport/libGoogleDataTransport.a(GDTCCTCompressionHelper.o) [...] (ld: 105 duplicate symbols for architecture arm64)

I'm new in react-native, any help will be apreciated.

CodePudding user response:

The problem can be at many places.

  • You may have linked it twice and that is the reason there is a duplicate file on the given path.

or

  • there you are trying to link two different files with the same names.

Or it can be something else the error you have put is very generic. My advice is to go to the path and check if there are two files with exact same name and extension. Or go to the Compile resources and check if the file mentioned here is linked twice.

How to go to compile resources path: https://stackoverflow.com/a/66108637/6654562

CodePudding user response:

Try below steps

  1. Run rm -rf ~/Library/Developer/Xcode/DerivedData/* to remove DerivedData
  2. Delete ios/pods folder
  3. Delete ios/build folder
  4. Delete Podfile.lock
  5. Remove DEAD_CODE_STRIPPING option from ios/app.xcodeproj/project.pbxproj if it's used there
  6. Run pod install and try rebuild
  • Related