Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

All RestKit projects fail to build when archiving

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 (restkit.org). I have started using a branch (402-new-build-process) that is more compatible with xcode4.2.

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"

like image 695
Richard Stelling Avatar asked Nov 28 '11 22:11

Richard Stelling


2 Answers

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

like image 180
Jamie Reynolds Avatar answered Nov 02 '22 13:11

Jamie Reynolds


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"
like image 3
vinzenzweber Avatar answered Nov 02 '22 13:11

vinzenzweber