8
votes

I have a project file with a Podfile that looks like this:

platform :ios, '7.0' 

def import_pods
pod 'Specta', '0.1.8' 
pod 'Expecta', '0.2.1' 
pod 'RestKit', '0.20.3' 
pod 'MagicalRecord', '2.1' 
pod 'RestKit/Testing', '0.20.3' 
end 

link_with 'LocalMedTests' 
import_pods

When I run pod install, it generates the Podfile.lock, Pods directory, and workspace for my project. When I open the workspace to build it, I get errors like this: 'RestKit.h' file not found.

It seems to only be an issue for RestKit but I can't get past those errors to see if there are more. The restkit headers are in Pods/Headers. They're properly included in Pods.xcconfig. Here it is for good measure:

FRAMEWORK_SEARCH_PATHS = $(inherited) "$(SDKROOT)/Developer/Library/Frameworks" "$(DEVELOPER_LIBRARY_DIR)/Frameworks" 

GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 

HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers" "${PODS_ROOT}/Headers/AFNetworking" "${PODS_ROOT}/Headers/Expecta" "${PODS_ROOT}/Headers/MagicalRecord" "${PODS_ROOT}/Headers/RestKit" "${PODS_ROOT}/Headers/RestKit/RestKit" "${PODS_ROOT}/Headers/RestKit/RestKit/CoreData" "${PODS_ROOT}/Headers/RestKit/RestKit/Network" "${PODS_ROOT}/Headers/RestKit/RestKit/ObjectMapping" "${PODS_ROOT}/Headers/RestKit/RestKit/Support" "${PODS_ROOT}/Headers/RestKit/RestKit/Testing" "${PODS_ROOT}/Headers/SOCKit" "${PODS_ROOT}/Headers/Specta" "${PODS_ROOT}/Headers/TransitionKit" 

OTHER_LDFLAGS = -ObjC -framework CFNetwork -framework CoreData -framework Foundation -framework MobileCoreServices -framework Security -framework SenTestingKit -framework SystemConfiguration 

PODS_ROOT = ${SRCROOT}/Pods

I've tried cleaning and cleaning the build folder. It doesn't matter - I always get the header not found error.

I should also add that all of the header directories specified by Pods.xcconfig are included in the target as they should be.

Any ideas about this? I've been using CocoaPods in this project for a couple of months with no issue, did something change recently?

2
How are you importing the headers on your #imports? - Marcelo Fabri
#import <RestKit/RestKit.h> but I've tried several variations with no luck. And it had been working fine before I deleted /Pods and had CocoaPods generate them (and the workspace) again. - Evan Cordell
I'm having a similar problem with our cocoapod installer (private cocoapod repo). All of a sudden the headers are not getting linked in. I've been following several leads making sure Pods.xcconfig looks right, but I can't get it working. - atroutt
I didn't really find a solution. I reverted back to my old workspace files (where everything linked properly), and made sure pods.xcconfig was referenced in the right places. Doing it from scratch still doesn't work for me, and I've no idea why. - Evan Cordell
I have tried doing [sudo] gem update but still no luck. I have old project which is working fine but if I do pod install now ... it will give the issue like project header not found :( - Bishal Ghimire

2 Answers

10
votes

This solved my Problem

In HEADER_SEARCH_PATHS Under your Project Build Setting add the $(inherited)

Also DO this for all TAGETS

Change Arcgitectures to Standard armv7 enter image description here

https://stackoverflow.com/a/12142790/1294448

2
votes

For me, the problem was with Other Linker Flags and Runpath Search Paths, which weren't inheriting the settings defined on xcconfig. The following adjustments solved my problem:

Other Linker Flags:

$(inherited)

Runpath Search Paths:

$(inherited)
@executable_path/Frameworks