Search code examples
iosxcoderestkitcocoapods

Error that RestKit.h was not found


I’m not certain that this is a RestKit issue, and I’ve tried reinstalling RestKit via CocoaPods many times, but eventually I get this error:

<RestKit/RestKit.h> file not found

Everything compiles fine, and RestKit works. I've set the header search paths to $(inherited), just as with other linker flags.

This is unfortunate, because now the autocomplete for those classes isn’t working.

I’ve tried cleaning, deleting derived data, and restarting Xcode, all to no avail.


Solution

  • I came across this question when having the same problem, but I had a very different solution that worked right away.

    For whatever reason, sometimes a project seems to lose track of some settings that relate to CocoaPods. In my case it was triggered when I downloaded a project from a repository that had been set up by someone else - even running "pods install" again did not remove the compilation error.

    I finally ran across the solution somewhere, the project needs to make use of Pods config files for your target. Go into your project settings "Info" tab, open the "Configurations" section. Expand both Debug and Release, check to make sure that for your project have the "pods" configuration set. If not, click on the drop down and select "pods" for Debug and Release - now compile and the error should go away.

    Here's an image showing exactly what part of the XCode configuration I'm talking about.

    Pods Configuration set for project