2

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

Imodeveloper
  • 93
  • 2
  • 8

6 Answers6

5

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

Asad Khan
  • 365
  • 3
  • 7
3

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.

Piyush Sharma
  • 1,891
  • 16
  • 23
1

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.

Bryan
  • 3,199
  • 3
  • 16
  • 24
0

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.

Dima Cheverda
  • 402
  • 1
  • 4
  • 10
  • I have did how you wrote and I have other error `Undefined symbols for architecture arm64: "_RKLogCoreDataError", referenced from: ___33-[RKEntityByAttributeCache load:]_block_invoke in libRestKit.a(RKEntityByAttributeCache.o) ___43-[RKManagedObjectImporter finishImporting:]_block_invoke in libRestKit.a(RKManagedObjectImporter.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ` – Imodeveloper Oct 27 '15 at 15:28
  • maybe try to remove cocoapods and reinstall them, and remove DerivedData, module cache, reload Xcode etc. This kind of mistakes sometimes happens with RestKit. – Dima Cheverda Oct 27 '15 at 15:42
  • I have tried to to do all you propose, and didn't help :( I don't know whats wrong here. – Imodeveloper Oct 27 '15 at 15:58
  • Long ago I also had the same issue with `RKObjectMapping.h`, and it wasn't problem with pods. But next day it disappeared, even I hasn't made any changes. Weird. – Dima Cheverda Oct 27 '15 at 16:30
0

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;
Community
  • 1
  • 1
Sophy Swicz
  • 1,307
  • 11
  • 21
0

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

Daniel S.
  • 730
  • 6
  • 14