Xcode 7.1 header not found
Asked Answered
S

4

16

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.

Sirree answered 27/10, 2015 at 6:22 Comment(2)
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 [issues.apache.org/jira/browse/CB-9656]Kira
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 regardSirree
K
19

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.

Kira answered 27/10, 2015 at 12:49 Comment(3)
I 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.Directly
I 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.Grajeda
Great! I tried exactly in the target search header release section by adding this : $(BUILD_ROOT)/../IntermediateBuildFilesPath/HeadersThermopylae
D
10

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.

Duprey answered 30/10, 2015 at 13:47 Comment(1)
K
3

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.

Karafuto answered 2/12, 2015 at 12:27 Comment(1)
You, sir, saved my life :-) I was about to give up here! Now everything makes sense...Rost
U
1

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.

Unaneled answered 20/7, 2016 at 22:4 Comment(4)
"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.Gabion
@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.Unaneled
Then 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)Gabion
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.Unaneled

© 2022 - 2024 — McMap. All rights reserved.