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

前端 未结 25 1042
一生所求
一生所求 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 05:01

    I was testing the Sparkle framework with CocoaPods.

    Sadly, I put pod 'Sparkle', '~> 1.21' in the PodFile in the wrong place. I put it underneath Testing (for unit tests).

    Once placed in correct spot in PodFile, everything's fine.

    0 讨论(0)
  • 2020-11-28 05:02

    Select the project-> Build Phase->Link Binary with libraries and add all pod libraries.

    0 讨论(0)
  • 2020-11-28 05:03

    the only thing that worked for me was to run pod deintegrate and pod install

    0 讨论(0)
  • 2020-11-28 05:03

    In my case, I was producing multiple products from the same project. For one of the products, the main.m file imported a header file from another folder under the same project. But that file was not included in "Complied Sources" under "Build Phase". This caused a linker error.

    After carefully comparing the "Build Phases" settings for a product that could be built successfully, I realized that the .m file of the header needs to be included in the list of "Compiled Source". My issue was resolved after adding that file. Attaching a picture for clarity. The highlighted file had to be added.

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

    A lot of solutions are mentioned above. No one worked for me(but please try above first).

    Select Project -> Select Target -> Linked Framework and Libraries -> Add all pod libraries . (remove if they exist in embedded binaries)

    Now remove these from Framework Folder in left file explorer of xcode.

    This solved my issue.

    0 讨论(0)
  • 2020-11-28 05:05

    I k now the question has already been answered. But if this helps somebody save some time : I had the same error. I checked everything to find a very small and stupid mistake from my side. I imported a core data ManagedObject custom file in a view controller of my project. I accidentally imported the .m file instead of the .h file which was causing the duplicate symbol in architecture error (linker command failed) because my .m file of properties class imports the .h file of core data class and hence causing duplicate import.

    So just check if u have imported the right files before you try multiple solutions.!

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