Question

THIS QUESTION REFERS TO RESTKIT 0.9.x.

IF YOU ARE NEW TO RESTKIT CONSIDER USING THE NEWER 0.10.x branch.

I recently inherited a project that uses (restkit.org). I have started using a branch (402-new-build-process) that is more compatible with .

My project an all the example projects build and run, but when it comes to Archiving an app the build fails:

/Users/AUser/Documents/SubFolder/stable-branches/project-iOS-client/RestKit/Examples/RKTwitterCoreData/Classes/RKTwitterAppDelegate.m:9:9: fatal error: 'RestKit/RestKit.h' file not found [2]
 #import <RestKit/RestKit.h>
         ^
1 error generated.

Xcode - failed to archive rest kit example project

I have followed the Installation Troubleshooting guide on the project wiki, but this did not work.

As per Blake's answer I am building to the DerivedData directory:

DerivedData directory settings

In addition I have tried setting header search to these (in many combinations [just guesses]):

"$(BUILD_DIR)/RestKit/Build"
"$(SOURCE_ROOT)/RestKit/Build"
"$(SOURCE_ROOT)/../../Build"
"$(BUILD_DIR)/../../Build"

Was it helpful?

Solution

!!!Update to the latest version of the branch!!!

I've just built RKCatalog and RKTwitterCoreData as an archive on Xcode 4.2 without issue. I am failing due to a Code Signing issue. Have you confirmed that you are building with the DerivedData directory:

RestKit assumes that you are using a modern Xcode project building to the DerivedData directory. Confirm your settings via the "File" menu > "Project Settings...". On the "Build" tab within the sheet that opens, click the "Advanced..." button and confirm that your "Build Location" is the "Derived Data Location".

I can push changes that rsync the headers to a known location, but I was hoping that standardizing on DerivedData would simplify the process.

OTHER TIPS

I think all these fixes were stabs in the dark, or at least felt like that to me. I half expected to read one about getting some hair from a young virgin and burning it over the Mac.

If it compiles for you in dev but not for archive its bound to be something simple. Or at least it was for me.

My source files were not in the right place:

The search header was set to "$(SOURCE_ROOT)/RestKit/Build"

But I had simply dragged the proj file from where I downloaded it into XCode. This was never an issue when compiling for debug etc. Just when archiving so I didnt spot it for a while.

Just make sure what ever that path is to the RestKit/Build is where the actual files are.

Fixed it for me, unlike all the cross your finger fixes I've read. Like moving headers into a group etc... what a load of rubbish that was.

Good luck, hope this helps. Thanks to the Restkit team, this really is a great framework.

Jamie

I am building against the development branch and integrate RestKit as a submodule in my root git folder

+ root project folder
|--+ RestKit
|--+ <Projectname> 
   |--+ <Projectname>.xcodeproj

So I use the following search paths

"$(BUILT_PRODUCTS_DIR)/../../Headers"
"$(SOURCE_ROOT)/../RestKit/Build"

To reiterate Jamie Reynolds answer, most (if not all) of you have set your header search paths to "$(SOURCE_ROOT)/RestKit/Build", this is fine while debugging and also fine for archiving, unless of course your Restkit framework IS actually in this directory.

Like the majority of you out there, you have probably just linked to the framework from the default download directory, in which case go to finder, open Restkit->Build cmd+i to see the info and select the directory path, copy and replace "$(SOURCE_ROOT)/RestKit/Build", dont forget the brackets.

mine was "/Users/edwin-b/Downloads/RestKit-RestKit-8d0d9fc/Build" worked like a charm

I followed the steps outlined in several SO answers, and the issue ended up being a problem with the Header Search Paths. Sometime between adding RestKit in XCode 4.2 and trying to archive in XCode 4.3.1 (I had updated twice between starting the project and providing a build), a comma had been injected in the Header Search Path list which Xcode could no longer parse. As a result, the entry for RestKit's header location was:

"$(SOURCE_ROOT)/RestKit/Build", 

When it should have just been:

"$(SOURCE_ROOT)/RestKit/Build"

While this didn't produce any issues building to device or sim, once I tried to archive, it caused the error reported by the OP.

Just add "$(SOURCE_ROOT)/RestKit/Build" to you target "Header Search Paths", Thanks to this answer.

I'm sure some of these are redundant, but I just spent over 3 hours debugging this thing and almost ruined my project in the process. So... Here you have it.

For the sake of your sanity, create a zip backup of your project before messing with RestKit project paths, commit all files (especially the project) to source control, cross your fingers, burn a virgin hair over your mac, then proceed.

After eliminating them one by one, I narrowed it down to this line allowing me to archive. "$(SOURCE_ROOT)/../RestKit/Build" Restkit is a folder at the same level as the main project folder

solution

I'm adding this answer so I can find it later - it matches some responses above. Look in your targets "Header Search Paths" - and depending on where your restkit directory is in your project, add one of the lines specified above in Alex Stones answer. In my case, it was "$(SOURCE_ROOT)/../RestKit/Build"

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top