I have added Unrar4iOS framework and getting below linker error.
How to fix this?
duplicate symbol __Z12CallbackProcjlll in:
/Users/dmitryvlasenko/Library/Developer/Xcode/DerivedData/UnrealReader-cpvucqqjfnkeppcasgjdrwasaryu/Build/Intermediates/UnrealReader.build/Debug-iphonesimulator/UnrealReader.build/Objects-normal/i386/Unrar4iOS.o
/Users/dmitryvlasenko/Desktop/UnrealReader/Unrar4iOS.framework/Unrar4iOS(Unrar4iOS.o)
duplicate symbol _OBJC_IVAR_$_Unrar4iOS.header in:
/Users/dmitryvlasenko/Desktop/UnrealReader/Unrar4iOS.framework/Unrar4iOS(Unrar4iOS.o)
duplicate symbol _OBJC_IVAR_$_Unrar4iOS._rarFile in:
/Users/dmitryvlasenko/Library/Developer/Xcode/DerivedData/UnrealReader-cpvucqqjfnkeppcasgjdrwasaryu/Build/Intermediates/UnrealReader.build/Debug-iphonesimulator/UnrealReader.build/Objects-normal/i386/Unrar4iOS.o
/Users/dmitryvlasenko/Desktop/UnrealReader/Unrar4iOS.framework/Unrar4iOS(Unrar4iOS.o)
duplicate symbol _OBJC_IVAR_$_Unrar4iOS.filename in:
/Users/dmitryvlasenko/Desktop/UnrealReader/Unrar4iOS.framework/Unrar4iOS(RARExtractException.o)
duplicate symbol _OBJC_EHTYPE_$_RARExtractException in:
/Users/dmitryvlasenko/Library/Developer/Xcode/DerivedData/UnrealReader-cpvucqqjfnkeppcasgjdrwasaryu/Build/Intermediates/UnrealReader.build/Debug-iphonesimulator/UnrealReader.build/Objects-normal/i386/RARExtractException.o
/Users/dmitryvlasenko/Desktop/UnrealReader/Unrar4iOS.framework/Unrar4iOS(RARExtractException.o)
ld: 12 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The error indicates to you that Unrar4iOS is both defined in Unrar4iOS.a and as individual file in your project.
So go to:
TargetSettings->Build Phases->Link Binary with Libraries and remove the Unrar4iOS.
Seems you have added the same library twice thats why it says "duplicate symbol __Z12CallbackProcjlll "
The Unrar library is written in C++. If you don't have any .mm files in your project, then Xcode doesn't link against the C++ standard library, and all the references to C++ fail to link.
Here is a compiled test well framework: Unrar4iOS.framework
Related
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
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.
I have been having a linker command problem and can't seem to resolve it. Normally cleaning the project and rebuilding fixes it, or deleting the derived data but this time it will not build.
The file PTKCard should no longer exist so I am not sure why it is mentioning those in the error. Some guidance would be greatly appreciated.
ld: warning: Auto-Linking supplied '/Users/rgainous/Documents/FacebookSDK/FBSDKCoreKit.framework/FBSDKCoreKit', framework linker option at /Users/rgainous/Documents/FacebookSDK/FBSDKCoreKit.framework/FBSDKCoreKit is not a dylib
ld: warning: Auto-Linking supplied '/Users/rgainous/Documents/FacebookSDK/Bolts.framework/Bolts', framework linker option at /Users/rgainous/Documents/FacebookSDK/Bolts.framework/Bolts is not a dylib
duplicate symbol _OBJC_METACLASS_$_PTKCard in:
/Users/rgainous/Library/Developer/Xcode/DerivedData/Runn-fvmsldafsswpesagnpiepcisxrtq/Build/Products/Debug-iphonesimulator/libPaymentKit.a(PTKCard.o)
/Users/rgainous/Library/Developer/Xcode/DerivedData/Runn-fvmsldafsswpesagnpiepcisxrtq/Build/Products/Debug-iphonesimulator/libStripe.a(STPPaymentCardTextField.o)
duplicate symbol _OBJC_CLASS_$_PTKCard in:
/Users/rgainous/Library/Developer/Xcode/DerivedData/Runn-fvmsldafsswpesagnpiepcisxrtq/Build/Products/Debug-iphonesimulator/libPaymentKit.a(PTKCard.o)
/Users/rgainous/Library/Developer/Xcode/DerivedData/Runn-fvmsldafsswpesagnpiepcisxrtq/Build/Products/Debug-iphonesimulator/libStripe.a(STPPaymentCardTextField.o)
duplicate symbol _OBJC_CLASS_$_PTKView in:
/Users/rgainous/Library/Developer/Xcode/DerivedData/Runn-fvmsldafsswpesagnpiepcisxrtq/Build/Products/Debug-iphonesimulator/libPaymentKit.a(PTKView.o)
/Users/rgainous/Library/Developer/Xcode/DerivedData/Runn-fvmsldafsswpesagnpiepcisxrtq/Build/Products/Debug-iphonesimulator/libStripe.a(STPPaymentCardTextField.o)
duplicate symbol _OBJC_METACLASS_$_PTKView in:
/Users/rgainous/Library/Developer/Xcode/DerivedData/Runn-fvmsldafsswpesagnpiepcisxrtq/Build/Products/Debug-iphonesimulator/libPaymentKit.a(PTKView.o)
/Users/rgainous/Library/Developer/Xcode/DerivedData/Runn-fvmsldafsswpesagnpiepcisxrtq/Build/Products/Debug-iphonesimulator/libStripe.a(STPPaymentCardTextField.o)
ld: 4 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Try deleting your derived data. And then clean build then build again.
Solution 1
You need to do this:
Click on your project (targets)
Click on Build Settings
Under Library Search Paths, delete the paths
May be this will help you.
Solution 2
You have duplicate symbol method which means there are duplicate file in project
In your Target's Build Phase, under "Compile Sources" check if there are duplicate file and delete one if you have duplication.
Hope this will help you.
I downloaded the SDK from the Cognito service, and installed it under this instruction (http://docs.aws.amazon.com/mobile/sdkforios/developerguide/setup.html).
I installed the pod, and added the frameworks to my project. When I tried to run my project, I got an error including ld: 6705 duplicate symbols for architecture x86_64.
For example:
duplicate symbol _OBJC_CLASS_$_AWSEC2ResponseSerializer in:
/Users/haichen/Library/Developer/Xcode/DerivedData/AWSTest-ceywyjkmugdxssfeodliqhmuehlz/Build/Products/Debug-iphonesimulator/libPods-AWSEC2.a(AWSEC2Service.o)
/Users/haichen/Documents/AWSTest/aws-ios-sdk-2.1.1/frameworks/AWSEC2.framework/AWSEC2(AWSEC2Service.o)
duplicate symbol _OBJC_METACLASS_$_AWSEC2ResponseSerializer in:
/Users/haichen/Library/Developer/Xcode/DerivedData/AWSTest-ceywyjkmugdxssfeodliqhmuehlz/Build/Products/Debug-iphonesimulator/libPods-AWSEC2.a(AWSEC2Service.o)
/Users/haichen/Documents/AWSTest/aws-ios-sdk-2.1.1/frameworks/AWSEC2.framework/AWSEC2(AWSEC2Service.o)
duplicate symbol _OBJC_CLASS_$_AWSEC2RequestRetryHandler in:
/Users/haichen/Library/Developer/Xcode/DerivedData/AWSTest-ceywyjkmugdxssfeodliqhmuehlz/Build/Products/Debug-iphonesimulator/libPods-AWSEC2.a(AWSEC2Service.o)
/Users/haichen/Documents/AWSTest/aws-ios-sdk-2.1.1/frameworks/AWSEC2.framework/AWSEC2(AWSEC2Service.o)
duplicate symbol _OBJC_METACLASS_$_AWSEC2RequestRetryHandler in:
/Users/haichen/Library/Developer/Xcode/DerivedData/AWSTest-ceywyjkmugdxssfeodliqhmuehlz/Build/Products/Debug-iphonesimulator/libPods-AWSEC2.a(AWSEC2Service.o)
/Users/haichen/Documents/AWSTest/aws-ios-sdk-2.1.1/frameworks/AWSEC2.framework/AWSEC2(AWSEC2Service.o)
duplicate symbol _OBJC_CLASS_$_AWSEC2 in:
/Users/haichen/Library/Developer/Xcode/DerivedData/AWSTest-ceywyjkmugdxssfeodliqhmuehlz/Build/Products/Debug-iphonesimulator/libPods-AWSEC2.a(AWSEC2Service.o)
/Users/haichen/Documents/AWSTest/aws-ios-sdk-2.1.1/frameworks/AWSEC2.framework/AWSEC2(AWSEC2Service.o)
duplicate symbol _OBJC_METACLASS_$_AWSEC2 in:
/Users/haichen/Library/Developer/Xcode/DerivedData/AWSTest-ceywyjkmugdxssfeodliqhmuehlz/Build/Products/Debug-iphonesimulator/libPods-AWSEC2.a(AWSEC2Service.o)
/Users/haichen/Documents/AWSTest/aws-ios-sdk-2.1.1/frameworks/AWSEC2.framework/AWSEC2(AWSEC2Service.o)
ld: 6705 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Could anyone help me find out the reason?
Close your project.
Clear all derived data.
Quit Xcode and reopen it
Make sure you open .xcworkspace file instead of .xcodeproj of your project.
To clear Derived Data:
XCode -> Window -> Projects
Select your project
press delete button in front of derived data
Let me know if it help
It looks like you are using both the frameworks and Cocoapods. You cannot import the SDK using both of the methods at the same time. You need to choose one of them and remove the other one.
Try deleting the derived data, clean the proj and re-compile.
I'm using Xcode Version 6.0.1 (6A317)and stuck with Apple Mach-O error for a long time. I get this error once I introduce SocketRocket project.
duplicate symbol _OBJC_IVAR_$_AppDelegate._window in:
/Users/anuradhavasudeva/Desktop/Buzz/Complete/CWPAYou/Build/Intermediates/CWPAYou.build/Debug-iphonesimulator/CWPAYou.build/Objects-normal/i386/AppDelegate-113CA4C4B5D4CC68.o
/Users/anuradhavasudeva/Desktop/Buzz/Complete/CWPAYou/Build/Intermediates/CWPAYou.build/Debug-iphonesimulator/CWPAYou.build/Objects-normal/i386/AppDelegate-D68FF7E1CDB59174.o
duplicate symbol _OBJC_METACLASS_$_AppDelegate in:
/Users/anuradhavasudeva/Desktop/Buzz/Complete/CWPAYou/Build/Intermediates/CWPAYou.build/Debug-iphonesimulator/CWPAYou.build/Objects-normal/i386/AppDelegate-113CA4C4B5D4CC68.o
/Users/anuradhavasudeva/Desktop/Buzz/Complete/CWPAYou/Build/Intermediates/CWPAYou.build/Debug-iphonesimulator/CWPAYou.build/Objects-normal/i386/AppDelegate-D68FF7E1CDB59174.o
duplicate symbol _OBJC_CLASS_$_AppDelegate in:
/Users/anuradhavasudeva/Desktop/Buzz/Complete/CWPAYou/Build/Intermediates/CWPAYou.build/Debug-iphonesimulator/CWPAYou.build/Objects-normal/i386/AppDelegate-113CA4C4B5D4CC68.o
/Users/anuradhavasudeva/Desktop/Buzz/Complete/CWPAYou/Build/Intermediates/CWPAYou.build/Debug-iphonesimulator/CWPAYou.build/Objects-normal/i386/AppDelegate-D68FF7E1CDB59174.o
duplicate symbol _OBJC_CLASS_$_ViewController in:
/Users/anuradhavasudeva/Desktop/Buzz/Complete/CWPAYou/Build/Intermediates/CWPAYou.build/Debug-iphonesimulator/CWPAYou.build/Objects-normal/i386/ViewController-7B952F801D984E6D.o
/Users/anuradhavasudeva/Desktop/Buzz/Complete/CWPAYou/Build/Intermediates/CWPAYou.build/Debug-iphonesimulator/CWPAYou.build/Objects-normal/i386/ViewController-99529767CD55CC78.o
duplicate symbol _OBJC_METACLASS_$_ViewController in:
/Users/anuradhavasudeva/Desktop/Buzz/Complete/CWPAYou/Build/Intermediates/CWPAYou.build/Debug-iphonesimulator/CWPAYou.build/Objects-normal/i386/ViewController-7B952F801D984E6D.o
/Users/anuradhavasudeva/Desktop/Buzz/Complete/CWPAYou/Build/Intermediates/CWPAYou.build/Debug-iphonesimulator/CWPAYou.build/Objects-normal/i386/ViewController-99529767CD55CC78.o
duplicate symbol _main in:
/Users/anuradhavasudeva/Desktop/Buzz/Complete/CWPAYou/Build/Intermediates/CWPAYou.build/Debug-iphonesimulator/CWPAYou.build/Objects-normal/i386/main-B74D1ABF07758C74.o
/Users/anuradhavasudeva/Desktop/Buzz/Complete/CWPAYou/Build/Intermediates/CWPAYou.build/Debug-iphonesimulator/CWPAYou.build/Objects-normal/i386/main-F48A7B3907D55170.o
ld: 6 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I have made sure to follow the steps given in https://github.com/square/SocketRocket
the only exception I see is SocketRocket.framework was showing red when I tried adding it under + Link Binary with libraries.
I have added the following libraries:
Security.Framework
CFNetwork.Framework
UIKit.Framework
Foundation.Framework
libicucore.dylib
libsocketrocket.a
libresolv.dylib
I've set other linker flags to -ObjC
Build Active Architecture only - No, because setting it to Yes throws an error : Check dependencies. No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=x86_64, VALID_ARCHS=i386).
Valid Architectures - armv64 armv7 armv7s
This issue is really killing my time. I tried to follow other posts but nothing could help me solve the issue!
1.- Are you importing a .m file inside another .m file instead of the Header? It happens by mistake some times and causes that issue.
2.- Check in your Compile Sources under Build Phases that you are not including same file 2 times although from the looks of it this doesn't seem the problem.
3.- If all else fails. Clean DerivedData folder for the project in Organizer. Clean and re-build.