During archive Xcode 7.1 does says Restkit/Restkit.h
not found but in debug it successfully found the header. It's an old project which do not uses cocoa pods so RestKit is added manually in it. Tried many solutions but not successful. Help required.

- 19,551
- 4
- 71
- 68

- 201
- 2
- 7
-
Have exactly the same issue. Working with RestKit 0.10.3 (non-cocoapods). Tried fiddling around with Search Header paths, but nothing worked until now. Also tried this [https://issues.apache.org/jira/browse/CB-9656] – FeltMarker Oct 27 '15 at 10:26
-
The cause of issue is that we have added "$(BUILT_PRODUCTS_DIR)/../../Headers" in header search paths , which looks for build/Release-iphoneos and then tracks back to Headers folder containing the file Restkit.h but unfortunately Release-iphoneos is not created during archieve in xcode 7.1 . May be you can find some help in this regard – Adnan Munir SE Oct 27 '15 at 10:44
4 Answers
Together with your suggestion and this SO post I managed to solve it by adding "$(BUILD_ROOT)/../IntermediateBuildFilesPath/Headers" (recursive) in the project build settings, Header Search Path for Release. Also set Skip Install = YES (build settings/deployment in the RestKit-project) and changed :
#import <RestKit/RestKit.h> to "RestKit/RestKit.h"
Note. Check in your xcode preferences/locations tab where the derived data is stored. Default is Unique build location. Then look in Finder for the folder IntermediateBuildFilesPath and search for the headers you are missing. Add this folder to the search path.

- 1
- 1

- 510
- 3
- 8
-
5I can confirm that adding "$(BUILD_ROOT)/../IntermediateBuildFilesPath/Headers" to RELEASE only solved it for me. I might be creating other problems later on down by not doing the additional steps, but for now, looks like I'm archiving fine. – EricWasTaken Oct 28 '15 at 15:54
-
2I also have a legacy project with RestKit and this worked for me too, thanks! Like eric I didn't make it recursive and didn't need to change the #import line. – zai chang Nov 18 '15 at 23:48
-
Great! I tried exactly in the target search header release section by adding this : $(BUILD_ROOT)/../IntermediateBuildFilesPath/Headers – Shobhakar Tiwari Jan 19 '16 at 09:31
I had the same issue. I added the following to the Header Search Paths build settings with non-recursive selected, and it solved my issue:
"$(BUILD_DIR)/../IntermediateBuildFilesPath/Headers"
I didn't have to change the import syntax or change any other build settings.

- 136
- 4
-
https://forums.developer.apple.com/message/79355#79355 https://github.com/RestKit/RestKit/issues/2341 – Dalibor Filus Mar 18 '16 at 09:00
Changing Header Search Paths to:
"$(BUILD_DIR)/../IntermediateBuildFilesPath/Headers" (non-recursive)
was correct way for me, too. For other subprojects, you should change Public headers folder path (Build Settings > Packaging) to
"../../Headers/$(TARGET_NAME)"
in subproject target's settings.

- 346
- 3
- 8
-
You, sir, saved my life :-) I was about to give up here! Now everything makes sense... – Bartserk Mar 01 '16 at 14:36
All of the above answers were part of the solution; however, in my case I ran into a detail that had me confused for a little while.
As per the answers above, I also updated the Header Search Paths (under Build Settings) by adding:
"$(BUILD_DIR)/../IntermediateBuildFilesPath/Headers" (non-recursive)
but that didn't work until I realized...
I was only updating the Project, and the Target was keeping the old paths.
So remember to update the Project paths AS WELL AS the Target paths.
ps, I didn't have to change any of the RestKit import statements.

- 870
- 11
- 19
-
"*one more note to that answer*" --> with 500 rep, you're more than qualified to leave a comment on the other answer. If you choose to leave an answer instead, at least explicitly link to the target answer you're referring to, to make it clear a year from now what you're talking about. – Andras Deak -- Слава Україні Jul 20 '16 at 22:19
-
@AndrasDeak, All the answers above refer to adding the same search path, the same solution. I found I didn't need to change import statements. – Nico teWinkel Jul 22 '16 at 23:48
-
1Then I suggest rephrasing your first sentence. Maybe remove the first sentence and make it clear that the existing method didn't work for you, and your actual answer is the second half of your post:) I *am* a layman, but it might be confusing to others too. (Just a suggestion, you can take it or leave it) – Andras Deak -- Слава Україні Jul 22 '16 at 23:49
-
ps, $(BUILD_DIR) can be substituted with $(BUILD_ROOT) as used in the above answers, and both ways work in Xcode 7.3 (they point to the same path), though I suppose that could change in the future. – Nico teWinkel Jul 22 '16 at 23:50