duplicate symbol _XBAnimationInterpolatorEaseInOut - ios

I've created a single view iOS app. Added pod 'XBPageCurl'. When I add #import "XBPageCurlView.h" to any view controller I get this error
duplicate symbol _XBAnimationInterpolatorEaseInOut in:
/Users/alexander/Library/Developer/Xcode/DerivedData/CurlTest-fphbvwtzauotgidxuqzdympohxqz/Build/Intermediates/CurlTest.build/Debug-iphoneos/CurlTest.build/Objects-normal/arm64/ViewController.o
/Users/alexander/Library/Developer/Xcode/DerivedData/CurlTest-fphbvwtzauotgidxuqzdympohxqz/Build/Products/Debug-iphoneos/libPods-XBPageCurl.a(XBAnimation.o)
ld: 4 duplicate symbols for architecture arm64
This is not happening with a test project from github.
Any idea how to get rid of it?

In build settings set "No Common Blocks" to NO

I removed any reference of interpolator block and moved the logic from it to - (BOOL)step:(NSTimeInterval)dt

Related

Xcode not generating correct coredata model files

Im generating my core data model after changing my models files using Editor -> Create NSManagedObj...
I changed an entity relationship to a different entity (if this matters)
Iv cleaned my project and build folder.
But the generated files don't seem to be correct, they include files such as 'Entity.h'
Which doesn't exist... As the only class files i see are 'Entity+CoreDataClass.h'
So i change the name manually to the all above errors and then i get a linker error:
duplicate symbol _OBJC_CLASS_$_Userinfo in:
/Users/Me/Library/Developer/Xcode/DerivedData/test-fxdxcviituhcmoegqygwirddhuir/Build/Intermediates/test.build/Debug-iphonesimulator/test.build/Objects-normal/x86_64/Userinfo+CoreDataClass.o
duplicate symbol _OBJC_METACLASS_$_Userinfo in:
/Users/Me/Library/Developer/Xcode/DerivedData/test-fxdxcviituhcmoegqygwirddhuir/Build/Intermediates/test/Debug-iphonesimulator/test/Objects-normal/x86_64/Userinfo+CoreDataClass.o
ld: 2 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Originally i created the project using an older version of Xcode, where the entity files such as 'Entity.h" were generated... Is this some sort of bug with Xcode after updating?
My entities are using the 'manual/none' codegen option. But i notice after building that the entity with the above linker error automatically changes to 'Class Definition'?
EDIT:
Ok so setting the codegen to class definition to all entities stops the wrong file import errors. (but then still revert back to 'manual/none' afterwards. Except for my newly created entity.
Where there is the error in the derriveddata for the +CoreDataClass.m file... where it does not include the +CoreDataClass in the import name.
My +CoreDataClass.m file within my project does not include this error and is correct with the +CoreDataClass.
My project generated file:
#import "Userinfo+CoreDataClass.h"
#import "User+CoreDataClass.h"
#implementation Userinfo
#end
Where the error exists: (in derived sources)
#import "Userinfo+CoreDataClass.h"
#import "User.h"
#implementation Userinfo
#end
Try to click on project. Next click the "Show version editor" (the top right button on the picture) button and try to find duplicated references and remove it.
Should solve the problem
I think I found the answer, in your xcddatamodel file after choosing your entity. On the right panel, you will see a "Code Generation" DropDown. It might default to Swift, change it to Objective c and build the project. Your file will be generated.

-Objc Other linker flags gives duplicate symbol error

I am using Unrar4iOS.Framework. It works fine but when I add -Objc other linker flags. it gives me duplicate error.
duplicate symbol __Z12CallbackProcjlll in:
Library/Developer/Xcode/DerivedData/SARUnArchiveANY-fgljekydpkmvrlgapbahtfvvhsdl/Build/Intermediates/SARUnArchiveANY.build/Debug-iphonesimulator/SARUnArchiveANY.build/Objects-normal/x86_64/Unrar4iOS.o
/My Project/SARUnArchiveANY-master/SARUnArchiveANY/vendor/Frameworks/Unrar4iOS.framework/Unrar4iOS(Unrar4iOS.o)
duplicate symbol _OBJC_IVAR_$_Unrar4iOS.header in:
Library/Developer/Xcode/DerivedData/SARUnArchiveANY-fgljekydpkmvrlgapbahtfvvhsdl/Build/Intermediates/SARUnArchiveANY.build/Debug-iphonesimulator/SARUnArchiveANY.build/Objects-normal/x86_64/Unrar4iOS.o
My Project/SARUnArchiveANY-master/SARUnArchiveANY/vendor/Frameworks/Unrar4iOS.framework/Unrar4iOS(Unrar4iOS.o)
duplicate symbol _OBJC_IVAR_$_Unrar4iOS.flags in:
Library/Developer/Xcode/DerivedData/SARUnArchiveANY-fgljekydpkmvrlgapbahtfvvhsdl/Build/Intermediates/SARUnArchiveANY.build/Debug-iphonesimulator/SARUnArchiveANY.build/Objects-normal/x86_64/Unrar4iOS.o
My Project/SARUnArchiveANY-master/SARUnArchiveANY/vendor/Frameworks/Unrar4iOS.framework/Unrar4iOS(Unrar4iOS.o)
I had require to add use Objc flag to use other library.
If you are specifying the -all_load or -Objc flag and the static libraries has the same symbol name of classes in your project,you’ll see these “duplicate symbol” errors in linking time.
reason why?
This flag causes the linker to load every object file in the library that defines an Objective-C class or category. While this option will typically result in a larger executable (due to additional object code loaded into the application), it will allow the successful creation of effective Objective-C static libraries that contain categories on existing classes.
from Apple official document.
In your project, Now, 3 symbol in Unrar4iOS.o has been crashed.
For example on your first duplicate symbol error log,
__Z12CallbackProcjlll symbol crashed in
(1) Library/Developer/Xcode/DerivedData/SARUnArchiveANY-fgljekydpkmvrlgapbahtfvvhsdl/Build/Intermediates/SARUnArchiveANY.build/Debug-iphonesimulator/SARUnArchiveANY.build/Objects-normal/x86_64/Unrar4iOS.o
(2) /My Project/SARUnArchiveANY-master/SARUnArchiveANY/vendor/Frameworks/Unrar4iOS.framework/Unrar4iOS(Unrar4iOS.o)
and the same pattern will go for the second and third duplicate symbol.
duplicate symbol __Z12CallbackProcjlll in:
Library/Developer/Xcode/DerivedData/SARUnArchiveANY-fgljekydpkmvrlgapbahtfvvhsdl/Build/Intermediates/SARUnArchiveANY.build/Debug-iphonesimulator/SARUnArchiveANY.build/Objects-normal/x86_64/Unrar4iOS.o
/My Project/SARUnArchiveANY-master/SARUnArchiveANY/vendor/Frameworks/Unrar4iOS.framework/Unrar4iOS(Unrar4iOS.o)
duplicate symbol _OBJC_IVAR_$_Unrar4iOS.header in:
Library/Developer/Xcode/DerivedData/SARUnArchiveANY-fgljekydpkmvrlgapbahtfvvhsdl/Build/Intermediates/SARUnArchiveANY.build/Debug-iphonesimulator/SARUnArchiveANY.build/Objects-normal/x86_64/Unrar4iOS.o
My Project/SARUnArchiveANY-master/SARUnArchiveANY/vendor/Frameworks/Unrar4iOS.framework/Unrar4iOS(Unrar4iOS.o)
duplicate symbol _OBJC_IVAR_$_Unrar4iOS.flags in:
Library/Developer/Xcode/DerivedData/SARUnArchiveANY-fgljekydpkmvrlgapbahtfvvhsdl/Build/Intermediates/SARUnArchiveANY.build/Debug-iphonesimulator/SARUnArchiveANY.build/Objects-normal/x86_64/Unrar4iOS.o
My Project/SARUnArchiveANY-master/SARUnArchiveANY/vendor/Frameworks/Unrar4iOS.framework/Unrar4iOS(Unrar4iOS.o)
So, To summary your project symptom, Now, in your project,Unrar4iOS.framework and SARUnArchiveANY library crashes each-other with three duplicated symbol in : Unrar4iOS object file.
Plus, below is the SARUnArchiveANY git repository introduction.
it already specified SARUnArchiveANY library contains Unrar4iOS.
SARUnArchiveANY
A very useful library for Unarchiving the .zip, .rar, .7z files for iOS.
Simply An Integration of the following libraries :
Unrar4iOS
SSZipArchive
LZMA SDK (7z)
from https://github.com/saru2020/SARUnArchiveANY
To solve the problem, I recommend this link.
http://atnan.com/blog/2012/01/12/avoiding-duplicate-symbol-errors-during-linking-by-removing-classes-from-static-libraries
you could solve the problem because I did it before already.

Duplicate symbol found

I have just imported MailCore2 into my project and I have followed all the steps that they have stated, but I am still getting an issue.
duplicate symbol _hmac_md5_final in:
XYZ/Debug-iphonesimulator/libetpan-ios.a(md5.o)
ABC/libs/libsmbclient.a(hmacmd5.o)
duplicate symbol _hmac_md5 in:
XYZ/Debug-iphonesimulator/libetpan-ios.a(md5.o)
ABC/libs/libsmbclient.a(hmacmd5.o) ld: 2 duplicate symbols for architecture x86_64
From what I can understand, _hmac_md5 and _hmac_md5_final appear in both of the files libetpan-ios.a * libsmbclient.a. In other posts people state that I need to remove one of the links or rename. I am using KxSMB and MailCore2 so I have no idea how to do any of these.
I have tried methods in other posts as much as I can follow them but:
I don't understand where I need to go.
I try them but end up getting far more errors.

Apple Mach-O Link

I got an error while compiling my code. The issue identifier labels it as 'Apple Mach-O Link Linker command failed'. I have no clue what this is so I have not been able to find a solution.
duplicate symbol _OBJC_METACLASS_$_XYZFlipsideViewController in:
/Users/studentuse/Library/Developer/Xcode/DerivedData/RSC-
aardgrngtzicssfffcbdqsezpqmv/Build/Intermediates/RSC.build/Debug-
iphonesimulator/RSC.build/Objects-normal/i386/XYZAppDelegate.o
/Users/studentuse/Library/Developer/Xcode/DerivedData/RSC-
aardgrngtzicssfffcbdqsezpqmv/Build/Intermediates/RSC.build/Debug-
iphonesimulator/RSC.build/Objects-normal/i386/XYZFlipsideViewController.o
ld: 6 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation) //This
line has the mistake
What is the problem with the code?
(This is only part of the code.)
The problem is that you have defined the implementation of the class XYZFlipsideViewController twice, and the linker can't figure out which definition you meant:
duplicate symbol _OBJC_METACLASS_$_XYZFlipsideViewController
The two places it is defined in are these two object files:
XYZAppDelegate.o
XYZFlipsideViewController.o
There are two possible explanations:
You have a #implementation XYZFlipsideViewController ... #end block in both of the source files XYZAppDelegate.m and XYZFlipsideViewController.m, or
You have the #implementation ... #end block inside a header file which is #include/#imported by both of those source files
In the first case, the solution is to remove one of the #implementation blocks. In the second case, the solution is to move the #implementation block from the header into the source file, but keep the #interface block in the header file.
It's important to understand the distinction between #interface and #implementation -- the former says "Here is the name of a class, the names of its instance variables, and the names of its member functions", whereas the latter says "Here are all the definitions of the class's properties and member functions".
Make sure and check your actual project directory for multiple files of the file it says you have duplicates of. Sometimes I forget to click send To trash vs remove reference when deleting and re creating files.
I am not sure this is your problem, but I have had similar problems like this before.
Good Luck! ^^

SPManagedObject creating "duplicate symbol" error

Simperium is giving me the following error:
ld: duplicate symbol [REDACTED]/Simperium.framework/Simperium(SPManagedObject.o) and [OTHER-REDACTED]/Build/Intermediates/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/i386/SPManagedObject.o
Any idea what causes this duplicate symbol bug? (I put REDACTED in there so it's not specific to my app)
You'll see this error if you accidentally auto-generate .h and .m files for the SPManagedObject entity in the model editor. You should only auto-generate files for your own entities, since Simperium.framework provides the SPManagedObject class for you.

Resources