Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RestKit and AFNetworking build error

When I attempt to import the RestKit api into a project I get the following error:

  /Documents/Code/RestTest/RestKit/Code/Network/RKHTTPRequestOperation.h:21:9:
 'AFNetworking.h' file not found

I have installed RestKit as a git submodule, how do I resolve RestKit's dependency on AFNetworking?

like image 587
Aran Mulholland Avatar asked Dec 06 '12 23:12

Aran Mulholland


2 Answers

Once cloned, simply do in the RestKit directory:

git submodule update --init --recursive

This will pull the AFNetworking version RestKit needs

like image 95
allaire Avatar answered Nov 07 '22 21:11

allaire


If you use CocoaPods will do all this automaticaly.

From RestKit install docs:

Install CocoaPods if not already available:

$ [sudo] gem install cocoapods
$ pod setup

Edit your Podfile and add RestKit:

$ edit Podfile
platform :ios, '5.0'
pod 'RestKit', :git => 'https://github.com/RestKit/RestKit.git', :branch => 'development'

Testing and Search are optional components

pod 'RestKit/Testing', :git => 'https://github.com/RestKit/RestKit.git', :branch => 'development'
pod 'RestKit/Search', :git => 'https://github.com/RestKit/RestKit.git', :branch => 'development'

Install into your project:

$ pod install

Please note that if your installation fails, it may be because you are installing with a version of Git lower than CocoaPods is expecting. Please ensure that you are running Git >= 1.8.0 by executing git --version. You can get a full picture of the installation details by executing pod install --verbose.

like image 3
Cornel Damian Avatar answered Nov 07 '22 22:11

Cornel Damian