Duplicate symbol _OBJC_CLASS_$_Base64 - ios

I am trying to add mobile.connect.framework to the existing project. Before adding the framework, The application is building and running properly. But, as soon as I am adding the framework, it is giving the Duplicate symbol OBJC_CLASS$_Base64 error. I went through numerous posts like Duplicate Symbol OBJC_CLASS$_LoginController
and How duplicate symbol problem arises. But was unable to find the solution.
Please help me how to resolve this one. It has already consumed my half a day.
Error :-
ld: warning: directory not found for option '-L/Users/shailendra.suriyal/Documents/MyProjects/..../UberNewUser/ExternalLib/CardIO' duplicate symbol _OBJC_CLASS_$_Base64 in: /Users/shailendra.suriyal/Library/Developer/Xcode/DerivedData/./Build/Intermediates/Muri.build/Debug-iphonesimulator/Muri.build/Objects-normal/x86_64/Base64.o /Users/shailendra.suriyal/Documents/MyProjects/..../UberNewUser/ExternalLib/FrameWork/mobile.connect.framework/mobile.connect duplicate symbol _OBJC_METACLASS_$_Base64 in: /Users/shailendra.suriyal/Library/Developer/Xcode/DerivedData/hadqxhhslzvmwfddwlthosrdljjy/Build/Intermediates/.../Debug-iphonesimulator/Muri.build/Objects-normal/x86_64/Base64.o /Users/shailendra.suriyal/Documents/MyProjects/.../UberNewUser/ExternalLib/FrameWork/mobile.connect.framework/mobile.connect ld: 2 duplicate symbols for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

Finally, I got it. I just removed the Base64.h from the compiled resources under Build Phases.

You seem to be linking both the source and the library for the Base64 class.
This line...
/Users/shailendra.suriyal/Library/Developer/Xcode/DerivedData/Muri-hadqxhhslzvmwfddwlthosrdljjy/Build/Intermediates/Muri.build/Debug-iphonesimulator/Muri.build/Objects-normal/x86_64/Base64.o
...says you've compiled the class directly.
This one...
/Users/shailendra.suriyal/Documents/MyProjects/taxi_ios_client/UberNewUser/ExternalLib/FrameWork/mobile.connect.framework/mobile.connect
...says you're linking it from inside the mobile.connect.framework binary.
If you're using it from the library, you should remove the source from your project.
(If you've already removed the source and you're still getting this, delete the derived data and try again.)

DUPLICATE FILE CREATES OF "LoginController"

Related

How to fix "Apple Mach-O Linker Error Group - clang: error: linker command failed with exit code 1 (use -v to see invocation)" Error

i create a new project with single page application, then i removed ViewController.h and .m file also deleted my story boards because i wanted to make a new class with UITableView subclass, after i build new storyBoard and changed the Main storyboard file base name in info.plist file to the new storyboard then i've got this error:
Apple Mach-O Linker Error Group
clang: error: linker command failed with exit code 1 (use -v to see invocation)
can anyone help me with it?
i figured out something, when i create NSManagedSubclass from my .xcdatamodeld core data file, it make 4 sub class for each entity like the pictur below:
and thats where the problem will create, i read that the problem is dublicate file, maybe duplicate #import syntax, i dont know how to fix this i tried to fix it by put the 2 .h file for each entity together but it didnt work and i've got more errors, so i appreciate if you guys help me.
this is the log:
duplicate symbol _OBJC_CLASS_$_Note in:
/Users/arashafshar/Library/Developer/Xcode/DerivedData/To_Dooz-eixtgqgyctrejleziaoxshnkdnym/Build/Intermediates/To Dooz.build/Debug-iphonesimulator/To Dooz.build/Objects-normal/x86_64/Note+CoreDataClass.o
duplicate symbol _OBJC_METACLASS_$_Note in:
/Users/arashafshar/Library/Developer/Xcode/DerivedData/To_Dooz-eixtgqgyctrejleziaoxshnkdnym/Build/Intermediates/To Dooz.build/Debug-iphonesimulator/To Dooz.build/Objects-normal/x86_64/Note+CoreDataClass.o
duplicate symbol _OBJC_CLASS_$_Setting in:
/Users/arashafshar/Library/Developer/Xcode/DerivedData/To_Dooz-eixtgqgyctrejleziaoxshnkdnym/Build/Intermediates/To Dooz.build/Debug-iphonesimulator/To Dooz.build/Objects-normal/x86_64/Setting+CoreDataClass.o
duplicate symbol _OBJC_METACLASS_$_Setting in:
/Users/arashafshar/Library/Developer/Xcode/DerivedData/To_Dooz-eixtgqgyctrejleziaoxshnkdnym/Build/Intermediates/To Dooz.build/Debug-iphonesimulator/To Dooz.build/Objects-normal/x86_64/Setting+CoreDataClass.o
ld: 4 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Follow carefully the instructions in this Technical Q&A. I think you might have not done step 2 in the first figure, where you need to select "Manual/None" in the "Codegen" dropdown.
Below solutions might work.
Try to find if there is any place where you have imported .m instead of .h file
if you are using cocoa pods then open .xcworkspace instead of .xcodeproj file
Here are some useful links for this kind of errors
Apple Mach-O Linker & Ditto Error - Xcode 8
Apple Mach-O Linker Error when compiling for device
Navigate to Build Phases in Xcode, then try to find if there were duplicated files in Compile Sources.
Hope that would hep you

How to get past this duplicate symbol error (Vungle, CodePush)?

How do I get past this error?
duplicate symbol _zipOpen4 in:
/Users/a/app/app-client/ios/Pods/VungleSDK-iOS/VungleSDK.embeddedframework/VungleSDK.framework/VungleSDK(vungle_zip.o)
/Users/a/Library/Developer/Xcode/DerivedData/AppClient-hirdjpuiiuosayehatqakfrifyvs/Build/Products/Debug-iphoneos/libCodePush.a(zip.o)
ld: 1 duplicate symbol for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The duplicate symbol is fairly generic and co-relates to many things. In this case
There could be three reasons. Vungle and CodePush might be using same constant names. Or Vungle may internally be using CodePush or vice-versa.
Try to include only one in them and see if it works. Chances are that you might be using both libraries in same interface/implementation if so try splitting code into multiple files.

ld: xx duplicate symbols for architecture armv7 Xcode Project

Hi everybody I have a Xcode project that gives me this error every time I try to build the project:
ld: xx duplicate symbols for architecture armv7 Xcode Project
clang: error: linker command failed with exit code 1...
I have googled around and most solutions say to get rid of duplicate files in the
build phase->Compile Resources section of the project or to change the import .m to .h in some files. Problem is the list of compiled resources isn't even sorted and I do not even know which files to fix since there are a lot of files in my project. Any advice on how on how to clean this up?
I have had this error sometimes, and the issue is always this. I have a static variable in the .m of one class, and another static variable with the same name in another .m. Apparently the compiler does not like it when there are two static variables with the same name, whether in different files or not. So check for any duplicate static variable names or #define macros. Also, it might not be duplicate files or files imported twice. If two different files are imported, but each has a variable or macro with the same name, there will be an error because the compiler can't figure out which one to use. The conflicting variables should be in the files mentioned in the error. Hope this helps!
There are certain Files in your project which may have been imported twice, try to analyse the error log, it must be referring the file where somewhere you must be getting an error as "YourViewCOntroller.O" its finding the double files,search for "YourViewCOntroller" in your project navigator, You need to remove these files from your Xcode project and then build again
If you are using Cocoapods like me, you may find that the other answers are not helping, because the duplicates are generated by the pod file automatically.
What worked for me was to look at the list of duplicate symbols, for example:
duplicate symbol _OBJC_METACLASS_$_AFImageCache in:
___/Build/Products/Debug-iphoneos/libPods-AFNetworking.a(UIImageView+AFNetworking.o)
___/Build/Products/Debug-iphoneos/libAFNetworking.a(UIImageView+AFNetworking.o)
ld: 214 duplicate symbols for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Then go to your project/target Build Settings -> Other Linker Flags and remove the reference to the duplicate pod (In my case, AFNetworking).
Clean, build again and it should work.
--
As far as I can tell, this may be happening because one of the other pods references AFNetworking, leading to a duplicate.

Conflicting libraries in iOS project

So basically I have two libraries that are I think conflicting with each other. I have the following settings for the key "Library Search path":
"$(SRCROOT)/projectname/Release-iphone/lib" for one of my libraries, and "$(SRCROOT)/projectname" for another.
I have added a CorePlot library into my project but to work it requires the following Linker Flags: -ObjC -all_load.
Now when I add one or both of them I get the following message and my project won't build:
duplicate symbol _OBJC_CLASS_$_GTMHTTPFetcher in:
/Users/user/Library/Developer/Xcode/DerivedData/projectname-chibchblpntaapfagqcohtkixhib/Build/Intermediates/projectname.build/Debug-iphoneos/projectname.build/Objects-normal/armv7/GTMHTTPFetcher.o
/Users/user/Dropbox/Projectname/projectname/projectname/libGTLTouchStaticLib.a(GTMHTTPFetcher.o)
duplicate symbol _OBJC_METACLASS_$_GTMHTTPFetcher in:
/Users/user/Library/Developer/Xcode/DerivedData/projectname-chibchblpntaapfagqcohtkixhib/Build/Intermediates/projectname.build/Debug-iphoneos/projectname.build/Objects-normal/armv7/GTMHTTPFetcher.o
/Users/user/Dropbox/Projectname/projectname/projectname/libGTLTouchStaticLib.a(GTMHTTPFetcher.o)
ld: 176 duplicate symbols for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The problem turns out to be with the Google API library libGTLTouchStaticLib.a but I don't get how do linker flags influence it.
It looks as though you have the source file included directly into your project as well as having a link to the library. You should choose one or the other (probably the library).
screw -all_load that was a hack to load categories. should work without it

Error: duplicate symbols for architecture armv7 after change Core Data Model

I have an app using core data framework. I was working fine. I just changed the data model - add an attribute to one entity.
And when I try to build it, I got an error:
duplicate symbol _OBJC_METACLASS_$_AccountFolder in:
/Users/XXX/Library/Developer/Xcode/DerivedData/MyApp-bxsswgxdenxgjweotkkkckaoalat/Build/Intermediates/MyApp.build/Debug-iphoneos/MyApp.build/Objects-normal/armv7/AccountFolder-33D7EA63E98D6090.o
ld: 4 duplicate symbols for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I did some search, and most people getting this error is from mistyping .h to .m, or import same .h several times. I checked my code. I don't have that.
And the coredata framework is still there.
Does anyone know what else can be the reason?
Thanks.
Check if there are multiple NSManagedObject subclass files generated after making this change. There should be duplicate files generated after your attribute change. Check in finder window as well as in project and then remove the duplicate files. That should fix this issue.

Resources