CocoaPods update RestKit #import "RKObjectMapping.h" file not found

2.7k views Asked by At

I want to update some of my project pods and after run pod update "some_framework" and try to build project appear this error:

import "RKObjectMapping.h" file not found

Current CocoaPod version is 0.39.0 I have tried to downgrade to 0.38.2 and lower but without any success, XCode version is 6.4 I have tried to change configuration of search path in Build Setting from non-recursive to recursive but again without success.

So I don't know what to do next, because I need to do some updates in project and RestKit is main framework for working with server side.

Podfile:

source 'https://github.com/CocoaPods/Specs.git' 
platform :ios, '7.1'
pod 'RestKit', '~> 0.24.1'
pod 'EZForm', '~> 1.1.0'
pod 'OCMock', '~> 3.0'
pod 'ImoDynamicTableView', '~> 1.1.273'
pod "ImoDynamicPopUp"
pod 'Masonry', '~> 0.6'

This is how error looks like, in Xcode: Error image

6

There are 6 answers

4
Dima Cheverda On

Had same issue few days ago. It seems that I had two CocoaPods version 0.39.0 and 0.38.2. When I removed 0.39.0 and updated pods it worked. Use gem list in terminal to see installed gems.

1
Piyush Sharma On

Imports in public header files should be #import <RestKit/Subdirectory/RKHeader.h> instead of #import "RKHeader.h"

This is required for RestKit to be compatible with future CocoaPods version because of CocoaPods/CocoaPods#4057 (The HEADER_SEARCH_PATHS will no longer be constructed recursively) introduced in 0.39.0.beta.1.

0
Asad Khan On

A little late to the party,I had same issue with cooca pod 0.39.0 and restkit 0.24.1 updated restkit to 0.26.0 and issue was fixed

0
Sophy Swicz On

I had the same issue, I did use 0.26.0 version of Restkit but 0.38.2 of cocoa pods. The only thing I'd to change after was selecting "Project Pods", and in "Build Settings -> Build Active Architecture Only" change to NO


[UPDATE]!!!! You can now follow the answer from @sajjon in this post from github to use cocopods versions: 0.39.0, 1.0.0 and 1.0.1

if anyone is having problems with RestKit 0.26.0 and Cocoapods 1.0.1, hopefully this will help!

This solution worked at least on 2016-06-03, but since it uses specific git branches maybe these will be merged, so if this does not work for you please check if this git branches have been merged/moved/deleted.

Clean up before everything

Quit Xcode

rm -rf Pods 
rm -rf MyApp.xcworkspace   
rm -rf ~/Library/Caches/CocoaPods 
rm -rf ~/Library/Developer/Xcode/DerivedData 

Use mcfedr's RestKit fork

Must be used together with "reachablility" branch of AFNetworking

pod 'AFNetworking', :git => 'https://github.com/mcfedr/AFNetworking.git', :branch =>
'reachability' 
pod 'RestKit', :git => 'https://github.com/mcfedr/RestKit.git', :branch => 'pods1' Use module

import syntax in Bridging Header

@import RestKit;
2
Daniel S. On

Updated to Cocoapods 1.1.1 and RestKit 0.26.0 and it works fine.

0
Bryan On

I know this is old, but the easiest way to fix this is to add ${PODS_ROOT} (and set it to recursive) in Header Seach Paths under Build Settings in your target settings.