I am losing my hair in my attempts to get RestKit to build and work. I get the dreaded \"Lexical or Preprocessor issue: RestKit/RestKit.h file not found\" message. I use Xc
I think I can shed some light on this.
When you upgrade to 0.10.0, you change your header search paths to "$(BUILT_PRODUCTS_DIR)/../../Headers"
, right?
The install guide only says to do this for the project settings. However in many cases, mine included, you'll need to also update them for the target settings as well.
The target settings will still have the old header search paths, and for whatever reason decide not to inherit from the project settings.
My solution:
When adding "$(BUILT_PRODUCTS_DIR)/../../Headers"
to
Targets -> Build Settings -> Search Paths -> Header Search paths,
the value was not set.
Instead the value has have been set up to User Header Search Paths. So you double click to Header Search Paths, some pane with lines appear, you click + down left, paste that string there, click somewhere else to dismiss the window and... nothing. The Header Search Paths didnt get updated but User Header Search Path did.
?!!!
So you click on the disclosure button on Header Search Paths. Click + sign right of the attribute and add the value...
Been fighting with the same issue for the past few hours. What finally worked for me (and I'm not saying this is a definite fix, but at least it's something to try).
This last step might be all that's necessary to fix it, but since I too was pulling my hair out over this, I tried a lot of different solutions and didn't want to assume that this last step was the sole reason it fixed itself.
(and my setup is XCode 4.3.2 and OS X 10.7.3)
I recently played around with upgrading from RestKit 0.9.3 to 0.10.0 and had the same thing. Did you delete the RestKit/build directory? This contains a copy of the .h files and is created as part of the build process when building 0.9.x. Doing Product -> Clean doesn't seem to delete these files. 0.10.0 doesn't seem to create this build directory. I suspect that your build errors are due to those files still being picked up.
Also, to answer your question fully, I keep RestKit files in:
(project dir)/Frameworks/RestKit
This is a git submodule so it contains a clone of the RestKit git repo at a particular revision.
And the header search path is:
$(BUILT_PRODUCTS_DIR)/../../Headers
The header search path for 0.9.3 was:
$(SOURCE_ROOT)/RestKit/Build
I found this guide helpful (maybe this is what you are already following): https://github.com/RestKit/RestKit/wiki/Installing-RestKit-in-Xcode-4.x and note the section about only having libRestKit.a in the project for the latest RestKit versions where earlier versions had all of:
If you have all of these, delete them from your project.
I had the exact same error today. All our code is in a github repo and the restkit folder is ignored so none of the restkit files were in there. Now, when xcode opens the project and finds stuff missing, it assumes all hell broke loose. So, deleted the folder, re cloned it and then grabbed a fresh copy of the restkit and threw it in there and voila, everything worked.
For me only these steps works. Check here Hope this will help.