Linker Command failed with exit code 1 (use -v to see invocation), Xcode 8, Swift 3

前端 未结 25 1040
一生所求
一生所求 2020-11-28 04:28

I can\'t get rid of this error!

I have tried all sorts of things like clearing Derived Data(Preferences->Locations->click gray arrow to open Derived Data fo

相关标签:
25条回答
  • 2020-11-28 04:43

    I had same problem.

    The cause was that I declared same global variable in 2 files. So it was showing same error saying 2 duplicate symbols.

    The solution was to remove those variables.

    0 讨论(0)
  • 2020-11-28 04:43

    In my case the reason of the error is library which was linked two times.

    I use react-native so it was linked automatically using react-native link and manually in xcode.

    0 讨论(0)
  • 2020-11-28 04:48

    For any one having this issue with Flurry framework. This is what fixed my issue. For me the issue was that i had imported the following files but never used them. "libFlurryTVOS_9.2.3" "libFlurryWatch_9.2.3"

    So all I had to do was go to project target settings and remove these 2 files from the "Linked framework and libraries" section and the problem was solved.

    0 讨论(0)
  • 2020-11-28 04:48

    Here is my problem and solution:

    I removed two files from the source code using source tree(Version controller). After applying the diff, that contains the two classes I removed, Xcode didn't add it automatically. So I got linker error.

    I manually added the files, by right click on group name and select "Add files to ". Now my error got resolved.

    If anyone faced the linker error regarding class file, then try to add it manually.

    0 讨论(0)
  • 2020-11-28 04:50

    Okay...So here is what solved my problem...

    in App Delegate File:

    #import "AppDelegate.h"
    #import "DarkSkyAPI.h"
    //#import "Credentials.h"
    

    I had imported Credentials.h already in the DarkSkyAPI.m file in my project. Commenting out the extra import made the error go away!

    Some things to mention and maybe help anyone in the future. @umairqureshi_6's answer did help me along the process, but did not solve it. He led to where I was able to dig out the info. I kept seeing AppDelegate and DarkSkyAPI files showing up in the error log and the information it was pulling from Credentials file was causing the error. I knew it had to be in one of these 3 files, so I immediately checked imports, because I remembered hearing that the .h carries all the imports from its .m file. Boom!

    0 讨论(0)
  • 2020-11-28 04:52

    I had the same problem using Carthage for dependencies.

    Just go to Select Project -> Build Settings -> Search for Enable Bitcode -> If it is selected to Yes, select No.

    That solved this problem for me.

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