8

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?

Evan Cordell
  • 4,108
  • 2
  • 31
  • 47
  • How are you importing the headers on your `#import`s? – Marcelo Jul 19 '13 at 22:32
  • `#import ` 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 Jul 20 '13 at 01:32
  • 1
    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 Aug 08 '13 at 14:59
  • 1
    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 Aug 08 '13 at 15:29
  • 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 Aug 22 '13 at 06:18

2 Answers2

10

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

Community
  • 1
  • 1
Bishal Ghimire
  • 2,580
  • 22
  • 37
  • NOTE : Making Architectures to amrv7 will no longer work due to apple restriction to make all app to work as 64bit. But don't forget to make same Architecture ie (Standard architectures ) to Pods as well as project. Also set Build Active Architecture Only to NO. – Bishal Ghimire Feb 19 '15 at 09:12
  • I had `$(inherited)` in `HEADER_SEARCH_PATHS`. Cmd + K fixed my problem. Thank you for posting this question. – Adrian Sep 18 '15 at 02:22
2

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
rgomesbr
  • 242
  • 3
  • 11