duplicate symbols for architecture armv7

前端 未结 16 1636
遥遥无期
遥遥无期 2020-12-01 01:46

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         


        
相关标签:
16条回答
  • 2020-12-01 02:27

    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.

    0 讨论(0)
  • 2020-12-01 02:28

    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.

    0 讨论(0)
  • 2020-12-01 02:30

    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;
    
    0 讨论(0)
  • 2020-12-01 02:31

    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.

    0 讨论(0)
  • 2020-12-01 02:32

    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.

    0 讨论(0)
  • 2020-12-01 02:35

    This can happen if you accidentally #import a .m file instead of the .h!

    0 讨论(0)
提交回复
热议问题