Error: ld: library not found for -lPods with CocoaPods

若如初见. 提交于 2019-11-27 04:22:16

Suggest trying the following, that worked for me:

a) Search from 'Library' from the Target Settings view and double-click to inspect the value of Library Search Paths

b) There are two values listed $(inherited) and $(PROJECT_DIR)/Pods/build/Debug-iphoneos. Delete the latter.

c) Do a full clean, build & run

d) Run pod install again. Notice that the entry is not restored.

kudinovdenis

Also this may help:

  1. In your main project (not Pods) select the main target
  2. Go to the Build Phases tab
  3. Go to Link Binary with Libraries
  4. Remove the library that is causing the problem (it would probably be in red color)

In my linked binaries I had both libPods.a and libPods-MyProj.a. I had previously updated my Podfile to have TWO separate targets (to get it compile tests in Swift with bridging), which meant I had to manually delete the old lidPods.a dependency.

Make sure you are opening the .xcworkspace file, not the .xcodeproj

I've found that $(inherited) was missing from my Other Linker Flags build setting. Applying this option fixed a missing library issue I was seeing.

I found that selecting "Find implicit Dependencies" (under product / edit scheme) will resolve this issue instead of having to add pods as a target.

Look for "Library Search Path" in you target's Build Settings page. change the folder name of Debug from Debug-iphoneos to Debug-iphonesimulator

There are so many reason caused this problem.

We need to check:

  • Build setting $(inherited)
  • Detect all implicit dependencies
  • .......

Troubleshooting: http://guides.cocoapods.org/using/troubleshooting.html

Make sure the missing pods library gets actually built. To do so, open the Build Scheme

Product > Scheme > Edit Scheme... > Build

add the Pods target and put it before the target that complained about the library missing (in my case this were the UI tests – I just struggled with this for hours...)

For me the error was: that the Pods target did not contain the required architecture slice for i386. So i clicked on the Pods project --> Pods-ProjectName target, and in Build Settings, turned Build Active Architecture Only to NO for both Debug and Release. This makes sure both the Simulator and Device slices are built. The simulator uses the i386 architecture, and the actual devices use x86-64. So you have to make sure all dependent targets for all dependent projects are building both, if you want to run on both Simulator and side loading to devices also.

When you use App extension, navigate to the extension target, and filter to Library Search Path, delete the path the compiler warning to you.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!