I know there are a lot of questions have been asked on Stack regarding that issue. I still cant figure out what wrong. I created private static library with Cocoapods. Then via podfile I integrate it in my project.(very common). Every time I receive the following error:
duplicate symbol _OBJC_CLASS_$_ARNStyles in:
/Users/My Name/Library/Developer/Xcode/DerivedData/testApp-evjgwyqlioietzfdxpqntltcyfhn/Build/Products/Debug-iphoneos/libPods-testApp-YooshUiIos.a(ARNStyles-B1E440918306D831.o)
duplicate symbol _OBJC_METACLASS_$_ARNStyles in:
/Users/My Name/Library/Developer/Xcode/DerivedData/testApp-evjgwyqlioietzfdxpqntltcyfhn/Build/Products/Debug-iphoneos/libPods-testApp-YooshUiIos.a(ARNStyles-B1E440918306D831.o)
ld: 2 duplicate symbols for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
What did I try :
To Run it on test clean project.
Changed LinkingFlags in the podsec in the project and in the pod itself.
There is only .h .m of that files.I didn't import .m file.
I read more or less all the question regarding that issue.
Did any one had the same problem?(or what else can I try)
Edit
its probably my podsec I have several other libraries and that get compiled with the same project.
Edit
I made all my files in one podsec instead of splitting them to different podsecs.And it compiled. (very strange)
Thanks a lot.
Related
I'm developing a framework "CurrentFramework" with a dependency "Dependency1", it works fine with running the example project, building the framework and testing.
but when i want to gather code coverage for the framework the following error occurs:
duplicate symbol '_lprofMergeValueProfData' in:
/directory/Documents/CurrentFrameworkProject/Pods/Dependency1/Dependency1.framework/Dependency1
/directory/Library/Developer/Xcode/DerivedData/CurrentFramework-hhnbyyjwzomjgjasdrewahvxlmyq/Build/Products/Debug-iphonesimulator/CurrentFramework.framework/CurrentFramework
ld: 1 duplicate symbol for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I tried doing this with 3 other frameworks importing "Dependency1", only 1 of them can get the code coverage data without error.
Some people suggested to check if i imported a ".m" instead of a ".h" somewhere but i don't think thats the case(i checked all the files)
This might not be the best answer, but here's some workaround i've done.
Make a file to store excluded symbol (_lprofMergeValueProfData). In this example i name it hidden_list.
hidden_list
Put the file on project root directory.
In your Xcode Project, Go to your Target and search Unexported Symbols File in Build Settings. add your file name containing list to exclude (hidden_list).
excluded_symbols
Run your project again, the error should be gone.
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.
what is the problem here, it builds with real iphone device but when I want to build/run it with iPhone Simulator it show like this
duplicate symbol _DictionaryForNode in:
/Users/**/Library/Developer/Xcode/DerivedData/**-gfeynokufbufhkgjzjzwlijxekpb/Build/Intermediates/**.build/Debug-iphonesimulator/**.build/Objects-normal/i386/XPathQuery.o
/Users/**/Downloads/SOAPEngine-master/SOAPEngine64.framework/SOAPEngine64(SOAPXPathQuery.o)
duplicate symbol _PerformXPathQuery in:
/Users/**/Library/Developer/Xcode/DerivedData/**-gfeynokufbufhkgjzjzwlijxekpb/Build/Intermediates/**.build/Debug-iphonesimulator/**.build/Objects-normal/i386/XPathQuery.o
/Users/**/Downloads/SOAPEngine-master/SOAPEngine64.framework/SOAPEngine64(SOAPXPathQuery.o)
ld: 2 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
FYI: there is no .m import or duplicate files in Build Phase
Select the target and check out Build Phases. Make sure the same file isn't listed more than once.
if you have XPathQuery.h/m in your project, in SOAPEngine it is already integrated, you need to remove only XPathQuery.m from your project, leave only XPathQuery.h, in the next version of SOAPEngine we'll fix this problem, please open an issue on GitHub for it.
duplicate symbol _OBJC_IVAR_$_MainPageScreenCollectionReusableView._mainPageScreenHeaderLabel in: /Users/bharathbalaraj/Library/Developer/Xcode/DerivedData/SentientiOS-anuolaqayswdbzakppukvtjatylz/Build/Intermediates/SentientiOS.build/Debug-iphonesimulator/SentientiOS.build/Objects-normal/x86_64/MainPageScreenCollectionReusableView-9480B7CE5B075E6A.o
duplicate symbol _OBJC_METACLASS_$_MainPageScreenCollectionReusableView in: /Users/bharathbalaraj/Library/Developer/Xcode/DerivedData/SentientiOS-anuolaqayswdbzakppukvtjatylz/Build/Intermediates/SentientiOS.build/Debug-iphonesimulator/SentientiOS.build/Objects-normal/x86_64/MainPageScreenCollectionReusableView-9480B7CE5B075E6A.o
duplicate symbol _OBJC_CLASS_$_MainPageScreenCollectionReusableView in: /Users/bharathbalaraj/Library/Developer/Xcode/DerivedData/SentientiOS-anuolaqayswdbzakppukvtjatylz/Build/Intermediates/SentientiOS.build/Debug-iphonesimulator/SentientiOS.build/Objects-normal/x86_64/MainPageScreenCollectionReusableView-9480B7CE5B075E6A.o
ld: 3 duplicate symbols for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ..
I am getting this error when I compile in xcode. Not sure how this is coming. Does anyone have a clue what is going on here?
You have added to the project same file multiple times. This usually happens when you add file to project, remove and then add it again.
The file causing this issue is MainPageScreenCollectionReusableView.
To resolve this issue go to Target-> Build phases-> in search field enter MainPageScreenCollectionReusableView and remove red ones.
I had similar error and it was #import loop (explained here)
You may need to change few #imports in .h files to #class and make actual #imports in .m files.
I added the XYPieChart folder into my Swift project on XCode 6 but now I'm getting this "Apple Mach-O Linker Error":
duplicate symbol _main in:
/Users/ansariha/Library/Developer/Xcode/DerivedData/Juxta-bjrfrzoyetsowibjdgpcxtesgwtg/Build/Intermediates/Juxta.build/Debug-iphonesimulator/Juxta.build/Objects-normal/i386/AppDelegate-EE692B7EDFB39C7A.o
/Users/ansariha/Library/Developer/Xcode/DerivedData/Juxta-bjrfrzoyetsowibjdgpcxtesgwtg/Build/Intermediates/Juxta.build/Debug-iphonesimulator/Juxta.build/Objects-normal/i386/main.o
ld: 1 duplicate symbol for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Below that it says "1 duplicate symbol for architecture i386" and then below that, the error: "Linker command failed with exit code 1 (use -v to see invocation)".
Has anyone ever seen this before?
Go to your project Bundle in xcode -> Build Phases -> Compile Sources
Check whether one of the files are added twice or not. This might be the case where such things happen.
Your AppDelegate might be added twice. Remove one of them.
Updated:
Some time you accidentally importing the .m file instead of the .h due to which this error comes. Please check and If this is not the reason, then perform the following steps
1- Check Build phases in Target settings.
2- Go to compile source section.
3- Check if any file exists twice or once.
4- If file exist twice delete one.
5- Build again.
This error occurs duplication of file in your project. click on The Project Navigator and search Duplicate file. in your project duplication of Appdelegate class or main. Remove one of file from your project.