最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Duplicate symbols for architecture arm64 - React-Native - Stack Overflow

programmeradmin6浏览0评论

I have a React-Native Project that works well, however, when I install vision-camera-code-scanner, the project stops building in XCode and I get the following error:

duplicate symbol '_OBJC_CLASS_$_GDTCCTCompressionHelper' in:
    /Users/XXX/Library/Developer/Xcode/DerivedData/XXX-xxx/Build/Products/Debug-iphoneos/GoogleDataTransport.o
    /Users/XXX/Library/Developer/Xcode/DerivedData/XXX-xxx/Build/Products/Debug-iphoneos/GoogleDataTransport/libGoogleDataTransport.a(GDTCCTCompressionHelper.o)

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

Looking in the log, the duplicate symbols are in:

GoogleDataTransport.o
libGoogleDataTransport.a

GoogleUtilities_Environment.o
libGoogleUtilities.a

GoogleUtilities_Logger.o
libGoogleUtilities.a

GoogleUtilities_UserDefaults.o
libGoogleUtilities.a

FBLPromises.o
libPromisesObjC.a

I tried to find duplicate files, but without success:

I am new in React-native, any idea on how to fix the duplicate symbols error?

I have a React-Native Project that works well, however, when I install vision-camera-code-scanner, the project stops building in XCode and I get the following error:

duplicate symbol '_OBJC_CLASS_$_GDTCCTCompressionHelper' in:
    /Users/XXX/Library/Developer/Xcode/DerivedData/XXX-xxx/Build/Products/Debug-iphoneos/GoogleDataTransport.o
    /Users/XXX/Library/Developer/Xcode/DerivedData/XXX-xxx/Build/Products/Debug-iphoneos/GoogleDataTransport/libGoogleDataTransport.a(GDTCCTCompressionHelper.o)

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

Looking in the log, the duplicate symbols are in:

GoogleDataTransport.o
libGoogleDataTransport.a

GoogleUtilities_Environment.o
libGoogleUtilities.a

GoogleUtilities_Logger.o
libGoogleUtilities.a

GoogleUtilities_UserDefaults.o
libGoogleUtilities.a

FBLPromises.o
libPromisesObjC.a

I tried to find duplicate files, but without success:

I am new in React-native, any idea on how to fix the duplicate symbols error?

Share Improve this question edited Dec 29, 2022 at 19:19 Rafael Pereira asked Dec 28, 2022 at 20:13 Rafael PereiraRafael Pereira 311 gold badge1 silver badge4 bronze badges 1
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Bot Commented Dec 29, 2022 at 5:11
Add a ment  | 

2 Answers 2

Reset to default 2

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 pile resources path: https://stackoverflow./a/66108637/6654562

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
发布评论

评论列表(0)

  1. 暂无评论