Xcode - ld: library not found for -lPods

后端 未结 22 1404
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-28 18:27

I get these errors when I try to build an iOS application.

ld: library not found for -lPods
clang: error: linker command failed with exit code 1 (use -v to s         


        
相关标签:
22条回答
  • 2020-11-28 19:01

    For me, following had worked.

    1. Go to "Project Target -> Build Settings -> Preprocessing -> Preprocessor Macros". Set "COCOAPODS=1" in all Debug, Integration, Release under "Preprocessor Macros"
    2. Add the following in "Other Linker Flags" under "Project Target"
      1. $inherited
      2. -ObjC
      3. -lc++
      4. -all_load

    Clean and run the project. If still error receives the same then try by setting "Project Target -> Build Settings -> Build Active Architectures Only", Set "Debug" to "YES" and set "Integration and Release" to "No". Then Repeat the same setting of "Build Active Architectures Only" for all "Pods Targets"

    Clean and run the project. If you receive the following error

     No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=x86_64, VALID_ARCHS=i386).
    

    Then try Mr. Mike answer in this link

    Xcode 5.1 - No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=x86_64, VALID_ARCHS=i386)

    Hope it helps!

    0 讨论(0)
  • 2020-11-28 19:01

    If the project uses CocoaPods be aware to always open the .xcworkspace file instead of the .xcodeproj file. if you are using .xcworkspace , Please reinstall the pod file by removing the pods and again insert the pods and install it !!! this worked for me

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

    The below solution worked for me for the core-plot 2.3 version. Do the below changes under other linker flags section.

    1.Add $(inherited) and drag this item to top position 2.Remove "Pods-" prefix from -l"Pods-fmemopen”, l"Pods-NSAttributedStringMarkdownParser” and -l"Pods-MagicalRecord”.

    if still issue persists, Finally see if PODS_ROOT is set or not. You can check it under user defined section.

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

    After hours of research this solution worked for me:

    (disclaimer: results may vary due to circumstances)

    the Library not found -lPods-(someCocoapod) error was due to multiple entries in the :

    Settings(Target) > Build Settings > Linking > 'Other Linker Flags'
    

    A lot of other posts had me look there and I would see changes to the error when I messed around with the entries, but I kept getting some variation on the same error.

    Too many hours lost ...

    My Fix:

    remove the -lPods-(someCocoaPod) lines in the 'Other Linker Flags' list BUT only if $(inherited) is at the top. At first I was unsure, but the reassuring sign was that I still saw references to my cocoapods when I left the edit mode(inherited). I tested in debug and release, both of which were giving me errors, and the problem was immediately resolved.

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