Solution 1:

Are you opening the workspace (that was generated by CocoaPods) instead of the xcodeproj?

Solution 2:

I separated the app and the test targets in the Podfile by using

target :App do
    …
end

target :AppTests do
    …
end

This resulted in two new products libPods-App.a and libPods-AppTests.a, respectively and they made the previous product libPods.a obsolete. I had to remove this product from the Link Binary With Libraries Section of the Build Phases configuration of both targets.

Solution 3:

I ran into a similar problem today.

  1. I setup a new project
  2. I installed cocoa pods
  3. I created a new configuration Preview along with the existing Debug and Release
  4. Now when compiling on this new Preview configuration, the compiler would not be able to link with Pods and giving me this message:

    ld: library not found for -lPods
    

The solution:

What I had to do was to run

 pod install

again and thus configuring cocoapods for the new Preview configuration. It updated my project, the workspace and the Pod's project file and the problem disappeared

Solution 4:

Be sure that you open .xcworkspace, not .xcodeproj

Solution 5:

Not a solution worked for me, this is really unbearable, there's a file libpods.a(which was red coloured) I removed it and everything working fine! Cheers to me ;)