iOS - Build fails with CocoaPods cannot find header files

Filip Majernik picture Filip Majernik · Aug 17, 2012 · Viewed 154.5k times · Source

I have an iOS project using CocoaPods. Everything was working smoothly until another developer started to work on the same project. He made some changes (only to code as far as I know) and made a new branch in the repo. I have checked out his branch and tried to build it, but I am getting an error: ASLogger/ASLogger.h file not found.

Even if I delete the whole project and make a fresh copy and use 'pods install .' the build failure is still there. Do you have any idea where the problem can be? If you need some more infos, just ask.

Answer

waggles picture waggles · May 23, 2013

Update

Make sure your Podfile includes link_with on targets missing a config file. Cocoapods only sets the first target by default otherwise. e.g.

platform :osx, '10.7'
pod 'JSONKit',       '~> 1.4'

link_with 'Pomo', 'Pomo Dev', 'Pomo Tests'

------ End Update


Note: Please do note that you have to look into Project->Info->Configurations for steps below.


I had similar symptoms and found that the pods.xcconfig file was not being included in the specific target I was trying to build. Some of the other suggested solutions worked for me, but this one seemed to address part of the underlying issue.

Pods.xcconfig not working

The simple solution was to change set the configuration file for the targets that didn't have one set.

Pods.xcconfig working