Getting following error when try to use Layar SDK in my existing app. How can I solve this?
Ld /Users/pnawale/Library/Developer/Xcode/DerivedData/hub-afxxzaq
I just fixed this error. I had CocoaPods installing a few frameworks (AWS, SDWebImage, AFNetworking. I manually dragged in 2 frameworks, Facebook and ImageIO. Most of my "duplicate symbol" errors were caught on Facebook classes. I deleted the framework and added it to the Podfile. Must have been an error or duplication in the libraries required by Facebook.
Generally, this kind of error occurs due to duplicate classes and xibs in your project folder. For example, in my project I had some class files duplicated(.h/.m files). You can see these duplicate classes under target->Build phases->compile sources
.
Just look and remove extra classes. Problem will be solved.
I also had duplicate symbols. I just renamed the procedure (app -> app1, app2) and the associated fields app.XXX -> app1.XXX . and it worked !
See : (in a .m file)
AppDelegate* app1;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
app1 = (AppDelegate *)[[UIApplication sharedApplication] delegate];
}
return self;
}
(...)
- (int) getLimit
{
if (app1.product2buyed)
return MAXID;
else if (app1.product1buyed)
return 70;
else
return 10;
I have faced this problem once before. The reason is that I copied some methods and variables declared in the implementation body from one class to another. So rename these methods and moved these variable to the interface declaration area => solved.
I had duplicate files in my Xcode. Physically there were one m-file and one h-file. But in project it were doubled causing duplicates in compile sources. After deleting duplicate m and h file problem was solved.
This can happen if you accidentally #import
a .m
file instead of the .h
!