Tagbangers Blog

The "Id: library not found for -I*library* error in Xcode

I kept facing the same error over and over again while using "CocoaPods", which many iOS developers out there should be familiar with, so I'll make a memorandum of the solution that eventually worked with me.

Id: library not found for -I*library*
clang: error: linker command failed with exit code 1 (use -v to see invocation)

This error sometimes happen when developing apps using CocoaPods. It indicates that whatever library that's shown after "-l" was unable to load, and the it failed to compile the file. At a glance, this might seem pretty easy to fix since the causes can be something simple like the file doesn't exist, or the link to the library is wrong.

But the thing is, life is not that simple.

If you google the error, these are the solutions you'll most likely get:

  • Reinstall CocoaPods
  • Delete libPods.a from Link Binary With Libraries, and add it again
  • Go to Manage Scheme → Pods Project and check "Share"

But what if it still doesn't work after trying out all of the solutions above? If so, first go to Edit Schemes → Build.

Add Pods Project in here and try Clean → Build. This process worked out for me. Depending on your settings, you might also have to go to Target Build Settings → Build Active Architecture Only and select Yes.

I never expected myself making such a basic mistake. But it is something people can easily miss out. So if you're having the same trouble, consider giving the methods above a try.


Original article written by: Ken-ichi Okumura

Translated by: Yu Koga