how to solve the duplicate symbols for architecture - ios

I built a mobile application with flutter framework and every time I run the application on ios devise this error appears and
Warning: The Copy Bundle Resources build phase contains this target's Info.plist file
'Runner/Info.plist'.
=== BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
duplicate symbol _kFIRInstanceIDDomain in:
/Users/tabarekaljaaf/Desktop/amafe/AMAFE/build/ios/Debug-iphonesimulator/FirebaseInstanceI
D/libFirebaseInstanceID.a(NSError+FIRInstanceID 2.o)
/Users/tabarekaljaaf/Desktop/amafe/AMAFE/build/ios/Debug-iphonesimulator/FirebaseInstanceI
D/libFirebaseInstanceID.a(NSError+FIRInstanceID.o)
duplicate symbol _kFIRMessagingDomain in:
/Users/tabarekaljaaf/Desktop/amafe/AMAFE/build/ios/Debug-iphonesimulator/FirebaseMessaging
/libFirebaseMessaging.a(NSError+FIRMessaging 2.o)
/Users/tabarekaljaaf/Desktop/amafe/AMAFE/build/ios/Debug-iphonesimulator/FirebaseMessaging
/libFirebaseMessaging.a(NSError+FIRMessaging.o)
duplicate symbol _GULNSDataZlibRemainingBytesKey in:
/Users/tabarekaljaaf/Desktop/amafe/AMAFE/build/ios/Debug-iphonesimulator/GoogleUtilities/l
ibGoogleUtilities.a(GULNSData+zlib 2.o)
/Users/tabarekaljaaf/Desktop/amafe/AMAFE/build/ios/Debug-iphonesimulator/GoogleUtilities/l
ibGoogleUtilities.a(GULNSData+zlib.o)
duplicate symbol _GULNSDataZlibErrorKey in:
/Users/tabarekaljaaf/Desktop/amafe/AMAFE/build/ios/Debug-iphonesimulator/GoogleUtilities/l
ibGoogleUtilities.a(GULNSData+zlib 2.o)
/Users/tabarekaljaaf/Desktop/amafe/AMAFE/build/ios/Debug-iphonesimulator/GoogleUtilities/l
ibGoogleUtilities.a(GULNSData+zlib.o)
duplicate symbol _GULNSDataZlibErrorDomain in:
/Users/tabarekaljaaf/Desktop/amafe/AMAFE/build/ios/Debug-iphonesimulator/GoogleUtilities/l
ibGoogleUtilities.a(GULNSData+zlib 2.o)
/Users/tabarekaljaaf/Desktop/amafe/AMAFE/build/ios/Debug-iphonesimulator/GoogleUtilities/l
ibGoogleUtilities.a(GULNSData+zlib.o)
ld: 5 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Could not build the application for the simulator. Error launching application on iPhone XR.
I don't have a background coding with Xcode how can I solve this

Related

ld: 2 duplicate symbols for architecture arm64

I added 2 third party framwekors but When I try to deploy I got this error
ld: 2 duplicate symbols for architecture arm64
duplicate symbol 'OBJC_CLASS$_Terminal' in:
/SDKThirdParty_1.a(Terminal.o)
/SDKThirdParty_2(Terminal.o)
duplicate symbol 'OBJC_METACLASS$_Terminal' in:
/SDKThirdParty_1(Terminal.o)
/SDKThirdParty_2(Terminal.o)
I try set "NO" in No CommonBlock also I search that file (Terminal.o) in compile sources but those files don't appear
Any ideas ?

Unity xCode Linker error - Trying to Debug

Trying to figure out how to even start debugging this issue. I'm using Google VR on Unity, deploying to xcode for the build to iOS devices. I"ve opened the workspace instead of the project in xcode as referenced in:
Xcode Project vs. Xcode Workspace - Differences
I've attempted to fix as referenced in:
Duplicate Symbols for Architecture arm64
Still getting the same error and have no idea where to go from here.
duplicate symbol _OBJC_CLASS_$_DeviceParamsSyncHelper in:
/Users/OriginDevIT/Documents/ODIT_ARVR/GP_Excel/builds/ios/V1.9.11.b11/Pods/GVRSDK/Libraries/libGVRSDK.a(DeviceParamsSyncHelper.mm.o)
/Users/OriginDevIT/Documents/ODIT_ARVR/GP_Excel/builds/ios/V1.9.11.b11/Libraries/Plugins/iOS/libgvrunity.a(DeviceParamsSyncHelper.mm.o)
duplicate symbol _OBJC_METACLASS_$_DeviceParamsSyncHelper in:
/Users/OriginDevIT/Documents/ODIT_ARVR/GP_Excel/builds/ios/V1.9.11.b11/Pods/GVRSDK/Libraries/libGVRSDK.a(DeviceParamsSyncHelper.mm.o)
/Users/OriginDevIT/Documents/ODIT_ARVR/GP_Excel/builds/ios/V1.9.11.b11/Libraries/Plugins/iOS/libgvrunity.a(DeviceParamsSyncHelper.mm.o)
ld: 2087 duplicate symbols for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Archive ReactNative got duplicate symbols for architecture arm64

I tried to archive an IOS project with ReactNative. Got this error:
duplicate symbol _OBJC_IVAR_$_RCTWebSocketModule._methodQueue in:
/Users/xuleyuan/Library/Developer/Xcode/DerivedData/SWCRN-ewdfdwvyvsgtsjbhztxszcugwdph/Build/Intermediates/ArchiveIntermediates/SWCRN/BuildProductsPath/Release-iphoneos/libReact.a(RCTWebSocketModule.o)
/Users/xuleyuan/Library/Developer/Xcode/DerivedData/SWCRN-ewdfdwvyvsgtsjbhztxszcugwdph/Build/Intermediates/ArchiveIntermediates/SWCRN/BuildProductsPath/Release-iphoneos/libRCTWebSocket.a(RCTWebSocketModule.o)
duplicate symbol _OBJC_IVAR_$_RCTWebSocketModule._sockets in:
/Users/xuleyuan/Library/Developer/Xcode/DerivedData/SWCRN-ewdfdwvyvsgtsjbhztxszcugwdph/Build/Intermediates/ArchiveIntermediates/SWCRN/BuildProductsPath/Release-iphoneos/libReact.a(RCTWebSocketModule.o)
/Users/xuleyuan/Library/Developer/Xcode/DerivedData/SWCRN-ewdfdwvyvsgtsjbhztxszcugwdph/Build/Intermediates/ArchiveIntermediates/SWCRN/BuildProductsPath/Release-iphoneos/libRCTWebSocket.a(RCTWebSocketModule.o)
duplicate symbol _OBJC_METACLASS_$_RCTWebSocketModule in:
/Users/xuleyuan/Library/Developer/Xcode/DerivedData/SWCRN-ewdfdwvyvsgtsjbhztxszcugwdph/Build/Intermediates/ArchiveIntermediates/SWCRN/BuildProductsPath/Release-iphoneos/libReact.a(RCTWebSocketModule.o)
/Users/xuleyuan/Library/Developer/Xcode/DerivedData/SWCRN-ewdfdwvyvsgtsjbhztxszcugwdph/Build/Intermediates/ArchiveIntermediates/SWCRN/BuildProductsPath/Release-iphoneos/libRCTWebSocket.a(RCTWebSocketModule.o)
ld: 441 duplicate symbols for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
But I can run it with simulator rightly.What I have done:
delete duplicate targets in pod and main project
search compile source but find nothing duplicate
turn off No Common Block of all the targets
In project/Pods I found a Headers folder which contains two folders named public and private with duplicate file .Should I delete one of them?
Finally. I solved this problem!
Just remove all about React in PodFile (Only React) and everything become pretty

Admob causing Apple Mach-O Linker Error when trying to archive project

When project is working fine when I try to run in simulator. However, when I try to archive the project, I got the follow error. The code is too long. I just putting some part of it.
duplicate symbol l017 in:
GoogleMobileAds.framework/GoogleMobileAds(GADBannerAdViewDelegate.o)
GoogleMobileAds(GADRewardBasedVideoAd+Mediation.o)
duplicate symbol l018 in:
GoogleMobileAds.framework/GoogleMobileAds(GADCSITimeRecorder.o)
GoogleMobileAds.framework/GoogleMobileAds(GADRewardBasedVideoAd+Mediation.o)
duplicate symbol l008 in:
GoogleMobileAds.framework/GoogleMobileAds(GADNativeAdAttributionView.o)
GoogleMobileAds.framework/GoogleMobileAds(GADPushTransitionView.o)
duplicate symbol l014 in:
GoogleMobileAds.framework/GoogleMobileAds(GADPinger.o)
GoogleMobileAds.framework/GoogleMobileAds(GADAdAppViewController.o)
ld: 28 duplicate symbols for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
How to solve this?
Problem solved by removing the "-ObjC" linker flag.

-ObjC linker flag - When trying to add it to "Other Linker Flags" I get an error

I'm trying to add the facebook SDK 3.2 to my app but after I add the -ObjC linker flag (as described in their video) I get a lot of duplicates warnings and I can't run the app with the error:
duplicate symbol _OBJC_IVAR_$_GAI.defaultTracker_ in:
/Users/gool/proj/Frameworks/GANT/libGoogleAnalytics.a(GAI.o)
/Users/gool/proj/Frameworks/GANT/libGoogleAnalytics_debug.a(GAI.o)
duplicate symbol _OBJC_IVAR_$_GAI.dispatcher_ in:
/Users/gool/proj/Frameworks/GANT/libGoogleAnalytics.a(GAI.o)
/Users/gool/proj/Frameworks/GANT/libGoogleAnalytics_debug.a(GAI.o)
duplicate symbol _kGAIProduct in:
/Users/gool/proj/Frameworks/GANT/libGoogleAnalytics.a(GAI.o)
/Users/gool/proj/Frameworks/GANT/libGoogleAnalytics_debug.a(GAI.o)
duplicate symbol _kGAIVersion in:
/Users/gool/proj/Frameworks/GANT/libGoogleAnalytics.a(GAI.o)
/Users/gool/proj/Frameworks/GANT/libGoogleAnalytics_debug.a(GAI.o)
duplicate symbol _OBJC_IVAR_$_GAI.trackUncaughtExceptions_ in:
/Users/gool/proj/Frameworks/GANT/libGoogleAnalytics.a(GAI.o)
/Users/gool/proj/Frameworks/GANT/libGoogleAnalytics_debug.a(GAI.o)
/Users/gool/Documents/FacebookSDK/FacebookSDK.framework/FacebookSDK(Facebook.o)
ld: 172 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Thanks
Deleting libGoogleAnalytics_debug.a and the facebook old sdk solved my problem

Resources