I created a static library which uses AFNetworking in key role to comunicate with backend.While testing, everything works great but when I tried to use AFNetworking on the test application by importing it again, I'm getting bunch of duplicate symbols errors
duplicate symbol _OBJC_CLASS_$_AFURLSessionManager in:
(AFURLSessionManager.o)
i386/AFURLSessionManager.o
duplicate symbol _OBJC_METACLASS_$_AFURLSessionManager in:
(AFURLSessionManager.o)
i386/AFURLSessionManager.o
ld: 205 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
i tried to -force_load option to force_load the library by adding
force_load $(SOURCE_ROOT)/testLib.a
in the other linker flags instead of -ObjC but It didn't help me either.
What do i need to do in order to use it without any hacky stuff?
I found this solution here
http://atastypixel.com/blog/avoiding-duplicate-symbol-issues-when-using-common-utilities-within-a-static-library/
but It's really not practical,
Related
I am having this error while running my project. I referred so many answers and did the same but can't resolve this issue.
duplicate symbol _kReachabilityChangedNotification in:
/Users/admin/Downloads/workRepo/SafetraxApp/MAppIOS/build2/Safetrax/Build/Intermediates/Safetrax.build/Debug-iphoneos/Parent App.build/Objects-normal/arm64/Reachability.o
Pods/catapush-ios-sdk-pod/CatapushKit/libCatapushLib.a(CLIntReachability.o)
ld: 1 duplicate symbol for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I assume you are using the Reachability snippet from Apple. Unfortunately, that piece of code and the accompanying constants are being used in several Cocoapods. That's what causes this error. It basically means that the symbol/constant kReachabilityChangedNotification has been defined twice in your binary: once in your Application and once in the CatapushKit pod.
The easiest way to fix is: Rename the constant in your code. The other option would be to delete the Reachbility code from your app and use the CLIntReachability implementation from CatapushKit.
Ok, so, I have some issues between MBProgressHUD (Pod) and (Scandit) (Vendor Framework).
In fact I was using MBProgressHUB from Pods before and it was working really well.
But after installing Scandit, I have the following error message :
ld: warning: directory not found for option '-FApp'
duplicate symbol _OBJC_CLASS_$_MBBarProgressView in:
/Users/nickName/Library/Developer/Xcode/DerivedData/appName-gqhyrdejqjmsbfgnidtyhwodtfnp/Build/Products/Debug-iphonesimulator/libMBProgressHUD.a(MBProgressHUD.o)
/Users/nickName/Projects/Git/appDirectory/ScanditBarcodeScanner.framework/ScanditBarcodeScanner(SCMBProgressHUD.o)
... 10 times ...
duplicate symbol _OBJC_IVAR_$_MBRoundProgressView._annular in:
/Users/nickName/Library/Developer/Xcode/DerivedData/appName-gqhyrdejqjmsbfgnidtyhwodtfnp/Build/Products/Debug-iphonesimulator/libMBProgressHUD.a(MBProgressHUD.o)
/Users/nickName/Projects/Git/appDirectory/ScanditBarcodeScanner.framework/ScanditBarcodeScanner(SCMBProgressHUD.o)
ld: 12 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The deduction is pretty simple; Scandit is using MBProgressHUD too... The problem is; I need to use MBProgressHUD on my project but I can't use it with Pods (conflict).
There is a way to use the MBProgress Framework contained by Scandit or can I use a trick to handle the error ?
Any answer will be very appreciate.
I am trying to integrate an ad network called 'adsmogo' http://adsmogo.com/.
I got duplicate symbol error for arm64, but it's ok with armv7.
I checked all similar questions on stackoverflow, but no one solved my problem.
duplicate symbol l108 in:
/Users/xxxxxx/Desktop/mm/mm/AdsMoGoLib/AdsMoGoSDK/libAdsMogo.a(AdMoGoView.o)
/Users/xxxxx/Desktop/mm/mm/AdsMoGoLib/AdsMoGoSDK/libAdsMogo.a(AdsMogoMraidJSBridge.o)
ld: 403 duplicate symbols for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
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 have tried all the answers available on stackoverflow but nothing seems to be working.
I get the following error whenever i create a (TCRecord)subclass of MMRecord.
Error:
duplicate symbol _MMRecordErrorDomain in:
/Users/mavericks/Library/Developer/Xcode/DerivedData/Beered-efrmoegppszsqtbcbtfrytgkdlyy/Build/Intermediates/Beered.build/Debug-iphonesimulator/Beered.build/Objects-normal/x86_64/TCRecord.o
/Users/mavericks/Library/Developer/Xcode/DerivedData/Beered-efrmoegppszsqtbcbtfrytgkdlyy/Build/Products/Debug-iphonesimulator/libPods-MMRecord.a(MMRecord.o)
ld: 1 duplicate symbol for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Things i have already tried:
Tried removing the -ObjC in other linker flags
I have already checked the directory for any duplicate files
Under Compile sources there is no duplication of implementation files.
Third party library i am using :
MMRecord
https://github.com/mutualmobile/MMRecord
For now, in your project settings, search for "gcc_no" and set the flag to NO until we get the issue fixed. That should allow you to build your project.
Try deleting extra frameworks that have no use.
Both My project and DocuSign project are using CMPopTipView open source code. Due that I facing following error during runtime.
Build/Products/Debug-iphoneos/libPods-CMPopTipView.a(CMPopTipView.o)
duplicate symbol _OBJC_METACLASS_$_CMPopTipView in:
/Users/Mani/Library/Developer/Xcode/DerivedData/myApp-cwzhebmptltodqbylbytaqjfetaa/Build/Intermediates/myApp.build/Debug-iphoneos/myApp.build/Objects-normal/arm64/CMPopTipView.o
/Users/Mani/Library/Developer/Xcode/DerivedData/myApp-cwzhebmptltodqbylbytaqjfetaa/Build/Products/Debug-iphoneos/libPods-CMPopTipView.a(CMPopTipView.o)
ld: 34 duplicate symbols for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Is there a way to remove dependency of DocuSignSDK for CMPopTipView and set it to use one present in my code base? if yes how?
Thanks,
Mani