Duplicate Symbols for Architecture arm64

前端 未结 24 2497
礼貌的吻别
礼貌的吻别 2020-12-02 16:21

When I try running my Xcode Project it fails with an error stating that I have duplicate symbols. I looked online where the find these duplicates but have had no luck:

相关标签:
24条回答
  • 2020-12-02 16:56

    Using Xcode 8, "Update project to recommended settings" option turned ON 'No Common Blocks' for my project.

    Turning it back to OFF fixed everything up.

    0 讨论(0)
  • 2020-12-02 16:59

    If you are moving to Xcode 7 or 8 and are opening a really old project, I've encountered this problem:

    in SomeConstFile.h

    NSString * const kAConstant;
    

    in SomeConstFile.m

    NSString *const kAConstant = @"a constant";
    

    Earlier versions of the compiler assumed that the definition in the header file was extern and so including SomeConstFile.h all over the place was fine.

    Now you need to explicitly declare these consts as extern:

    in SomeConstFile.h

    extern NSString * const kAConstant;
    
    0 讨论(0)
  • 2020-12-02 17:02

    For me, I created a method called sampleMethod in ViewController_A and created the same method in ViewController_B too, It caused me this error, then i changed the method name in ViewController_B to secondSampleMethod. It fixed the error.

    Seems like a Good feature to reduce the code and not to duplicate the same code in many places.

    I tried changing the No Common blocks from Yes to No then enabling testability from Yes to No. It didn't worked. I Checked duplicate files also in build phases, but there is no duplicate files.

    0 讨论(0)
  • 2020-12-02 17:04

    From the errors, it would appear that the FacebookSDK.framework already includes the Bolts.framework classes. Try removing the additional Bolts.framework from the project.

    0 讨论(0)
  • 2020-12-02 17:04

    Plz Change setting.

    Step 1: Go to TARGETS -> Build Settings -> No Common Blocks -> No

    Step 2: Go to TARGETS -> Build Settings -> enable testability -> No

    0 讨论(0)
  • 2020-12-02 17:06

    I got this issue because I was lazily defining a variable in my .m outside of a method, then in another .m file I was defining another variable with the same name outside a method. This was causing a global variable name duplicate issue.

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