RestKit / RestKit。文件未发现错误-版本0.10.0。

时间:2022-02-23 20:52:04

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 Xcode 4.2 & my project is for iOS.

我的头发在我的尝试中失去了我的头发,以建立和工作。我得到了可怕的“词汇或预处理问题:RestKit/RestKit”。文件未找到“消息”。我使用Xcode 4.2 &我的项目是iOS。

Earlier, I had debug mode working perfectly with RestKit 0.9.0. Then I ran into issues while trying to archive. After reading this forum and attempting some solutions, I decided to upgrade to 0.10.0 with hopes that it will solve the issue.

更早的时候,我调试模式与RestKit 0.9.0完美地工作。然后我在尝试归档的时候遇到了问题。在阅读了这个论坛并尝试了一些解决方案之后,我决定升级到0.10.0,希望它能解决这个问题。

Now, my project is not even building in debug mode and I get the same RestKit/RestKit.h file not found error.

现在,我的项目甚至没有在调试模式下构建,我得到了相同的RestKit/RestKit。文件未发现错误。

I have this under Header search path: "$(BUILT_PRODUCTS_DIR)/../../Headers". Can you please suggest (for 0.10.0 version): 1) Where should the physical location of RestKit be? (It may not matter, but which one worked for you - with hopes that I can mirror your setting) 2) I tried to point my header search path to "/Developer/Library/RestKit-RestKit-69adee9/" and later to "/Developer/Library/RestKit-RestKit-69adee9/Build"

我在标题搜索路径下有这个:“$(BUILT_PRODUCTS_DIR)/../../Header”。您能否建议(0.10.0版):1)RestKit的物理位置在哪里?(这可能不重要,但哪个对你有用——希望我能镜像你的设置)2)我试着将我的头搜索路径指向“/Developer/Library/RestKit-RestKit-69adee9/”,然后指向“/Developer/Library/RestKit-RestKit-69adee9/Build”

Throughly confused and frustrated..

彻底地困惑和沮丧。

EDIT1: After several hours, I gave up. Nuked my project. Created a fresh project. Re-created the files (copy paste from prev project). Now "RestKit not found" error is gone! But now, I am getting this other error:

几小时后,我放弃了。裸露我的项目。创建一个新的项目。重新创建文件(来自prev项目的复制粘贴)。现在“RestKit not found”错误已经消失!但是现在,我得到了另一个错误

Undefined symbols for architecture i386:
"_OBJC_CLASS_$_RKObjectMapping", referenced from:
objc-class-ref in myclassname1.o
"_OBJC_CLASS_$_RKObjectManager", referenced from:
objc-class-ref in myclassname2.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I checked & made sure that I did NOT add RestKit.framework... I've no idea why the clang error is happening now

我检查了一下,确保我没有添加RestKit.framework…我不知道为什么现在发生了铿锵的错误。

EDIT2: The libRestKit.a was red. It is OK according to https://github.com/RestKit/RestKit/wiki/Installation-Troubleshooting Just for the heck of it, I removed all the linked dependencies. Removed the "Other linker flags". Closed & reopened Xcode. Put them all back. That error is gone. Maybe I missed a framework which resulted in clang error. But it is highly unlikely for I checked & double checked. It works now.

EDIT2:libRestKit。一个是红色的。根据https://github.com/restkit/restkit/wiki/installationtroubleshooting,我删除了所有链接的依赖项。删除了“其他链接标记”。Xcode关闭和重新开放。把他们都回来了。这个错误消失了。也许我错过了一个导致clang错误的框架。但是我不太可能检查和复查。现在工作。

It builds & archives on debug mode. I haven't tried the distribution mode yet.

它在调试模式下构建和归档。我还没有尝试过分销模式。

EDIT3: Apple approved my app in the first go & it is live! I still do not know what caused the issue here. Nuking an existing project & creating a new one & copying over the old files (& periodically checking if build goes through) cannot be a solution. So I am leaving this question open.

EDIT3:苹果第一次批准了我的应用程序,它就是live!我仍然不知道这里的问题是什么。使用现有的项目,创建一个新项目并复制旧文件(并定期检查构建是否通过)并不是解决方案。所以我要把这个问题公开。

14 个解决方案

#1


10  

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?

当您升级到0.10.0时,您将更改头搜索路径到“$(BUILT_PRODUCTS_DIR)/../..”/头”,对吧?

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.

目标设置仍然有旧的头搜索路径,不管出于什么原因,决定不从项目设置继承。

#2


3  

Mind you - its a total hack - but it got my project running.

请注意,这完全是一种黑客行为,但它让我的项目得以运行。

Assuming that you've already followed the installation steps from the RestKit Github https://github.com/RestKit/RestKit/blob/master/README.md#quick-start-aka-tldr

假设您已经遵循了RestKit Github https://github.com/restkit/restkit/restkit/blob/master/readme的安装步骤。

In the RestKit target, goto Build Phases. Under the Copy Headers dropdown, move all of the header files from "Project" to "Public".

在RestKit目标中,goto构建阶段。在拷贝头下拉下,将所有头文件从“项目”移到“公共”。

Clean, Build, Run.

干净、构建、运行。

#3


3  

Solution I found was not to copy and past the "$(BUILT_PRODUCTS_DIR)/../../Headers" to your target's Header Search Paths.

我发现的解决方案不是复制并通过“$(BUILT_PRODUCTS_DIR)/.. ..”/标题“到你的目标的头搜索路径。

After five hours I deleted the copy and pasted " and manually typed them in and it worked.

5个小时后,我删除了复制粘贴,然后手工输入,然后就成功了。

#4


2  

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.

我最近从RestKit 0.9.3升级到0.10.0,并且有相同的功能。您是否删除了RestKit/build目录?这包含了.h文件的副本,并作为构建过程的一部分创建,当构建0.9 x时。做产品->清洁似乎没有删除这些文件。0.10.0似乎没有创建这个构建目录。我怀疑您的构建错误是由于那些文件仍然被拾取。

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.

此外,为了充分回答您的问题,我将RestKit文件保存在:(project dir)/框架/RestKit中,这是一个git子模块,因此它包含了一个特定修订版本的RestKit git repo的克隆。

And the header search path is:
$(BUILT_PRODUCTS_DIR)/../../Headers

并且头搜索路径是:$(BUILT_PRODUCTS_DIR)/../../ header。

The header search path for 0.9.3 was:
$(SOURCE_ROOT)/RestKit/Build

0.9.3的头搜索路径是:$(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:

我发现这个指南很有用(也许这就是你已经在做的):https://github.com/restkit/restkit/wiki/installing-restkitin - xcode -4.x,并注意到只有libRestKit的部分。一个在最新的RestKit版本的项目中,早期版本都有:

  • libRestKitNetwork.a
  • libRestKitNetwork.a
  • libRestKitObjectMapping.a
  • libRestKitObjectMapping.a
  • libRestKitSupport.a
  • libRestKitSupport.a
  • libRestKitJSONParserJSONKit.a
  • libRestKitJSONParserJSONKit.a
  • libRestKitXMLParserLibxml.a
  • libRestKitXMLParserLibxml.a
  • libRestKitCoreData.a
  • libRestKitCoreData.a

If you have all of these, delete them from your project.

如果你有这些,把它们从你的项目中删除。

#5


2  

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).

在过去的几个小时里一直在和同一个问题斗争。最终对我起作用的是(我并不是说这是一个确定的解决方案,但至少它是可以尝试的)。

  • Delete RestKit from your Project
  • 从项目中删除RestKit。
  • Close your project
  • 闭上你的项目
  • Move the RestKit folder next to your main xcodeproject
  • 将RestKit文件夹移到主xcodeproject的旁边。
  • Open the RestKit project and build it
  • 打开RestKit项目并构建它。
  • Close the RestKit project
  • 关闭RestKit项目
  • Open your project, and re-import the RestKit project into your xcodeproject
  • 打开您的项目,并将RestKit项目重新导入到xcodeproject中。
  • Fix the Dependencies and Linkings in the target settings
  • 在目标设置中修复依赖项和Linkings。
  • Add the "$(BUILT_PRODUCTS_DIR)/../../Headers" search path to BOTH the project settings and the target settings. (it only worked for me when they were listed in both).
  • 添加“$(BUILT_PRODUCTS_DIR)/ . . / . ./标题“搜索路径到项目设置和目标设置。(只有当它们同时被列在两者中时,它才会起作用。)

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)

(我的设置是XCode 4.3.2和OS X 10.7.3)

#6


1  

After spending 2 days on this same error and navigating to every possibile google result I finally got it!

在同样的错误上花费了2天时间,并导航到每一个可能的谷歌结果,我终于得到了它!

It's not due to Derived Data settings, those are fine already in XCode 4.3.2.

这不是由于派生的数据设置,这些已经在XCode 4.3.2中已经很好了。

The problem is that you are doing a #import "RKObjectMapping.h" or some other include.

问题是您正在执行一个#import“RKObjectMapping”。h或其他的包括。

Instead use @class RKObjectMapping or if you really nead the .h use <RestKit/RKObjectMapping.h>

相反,使用@class RKObjectMapping,或者如果您真的nead .h使用

I went with @class since I just need to compile...

我使用@class,因为我只需要编译…

Hope this help!

希望这次的帮助!

#7


1  

Had this problem too. It would build and run just fine on simulator, but would not archive. Here's where I went wrong...

也有这个问题。它会在模拟器上运行良好,但不会存档。这是我出错的地方……

I did this:

我这样做:

#import "RestKit.h"

Rather than the correct way:

而不是正确的方法:

#import <RestKit/RestKit.h>

#8


0  

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.

我今天犯了同样的错误。我们所有的代码都在github repo中,而restkit文件夹被忽略了,所以restkit文件没有在其中。现在,当xcode打开这个项目并发现丢失的东西时,它假定所有的东西都被破坏了。所以,删除了文件夹,重新克隆了它,然后抓取了一个新的restkit拷贝并把它扔到那里,瞧,一切都成功了。

#9


0  

I found that I need to manually build the RestKit target for the header files to be copied into the build directory. Apparently the master project build does not reliably run the subproject build?

我发现我需要手动构建RestKit目标,以便将头文件复制到构建目录中。显然,主项目构建并不可靠地运行子项目构建?

So, my steps for fixing this issue:

所以,我解决这个问题的步骤是:

  • Select the RestKit run target
  • 选择RestKit运行目标。
  • Build
  • 构建
  • Make sure the header search path was set on all target (apparently on project itself is not enough)
  • 确保标题搜索路径设置在所有目标上(显然,项目本身是不够的)
  • Build main project
  • 构建的主要项目

#10


0  

Had a very similar problem. It turned out to be I had accidentally added the build setting to "User Header Search Paths" rather than "Header Search Paths".

有一个非常相似的问题。结果是,我意外地将构建设置添加到“用户头搜索路径”而不是“头搜索路径”。

#11


0  

My solution:

我的解决方案:

When adding "$(BUILT_PRODUCTS_DIR)/../../Headers" to Targets -> Build Settings -> Search Paths -> Header Search paths, the value was not set.

当添加“$(BUILT_PRODUCTS_DIR)/ . . / . ./标题“目标->构建设置->搜索路径->头搜索路径,值未设置。

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...

所以你点击标题搜索路径上的信息披露按钮。单击+符号右的属性并添加值…

#12


0  

Here's a common mistake that'll make you want to slap yourself after you fix it.

这是一个常见的错误,它会让你在修复之后想扇自己一巴掌。

Yes, you definitely do want to add "$(BUILT_PRODUCTS_DIR)/../../Headers" to your target's Header Search Paths, but don't forget to include the quotes!

是的,您确实需要添加“$(BUILT_PRODUCTS_DIR)/../..”/Header“到你的目标的头搜索路径,但是不要忘记包含引号!

I'm talking about the quotes that are before $(BUILT and after _DIR)/../../Headers

我说的是在$(构建和之后的_DIR)/../../ header之前的引号。

If your build configuration has a space in the name (e.g. mine is 'Ad Hoc') and you've just added $(BUILT_PRODUCTS_DIR)/../../Headers without the leading and trailing quotes, you may end up getting the "Lexical or Preprocessor issue: RestKit/RestKit.h file not found" problem.

如果您的构建配置有一个名称空间(例如,我的是“临时的”),而您刚刚添加了$(BUILT_PRODUCTS_DIR)/../..没有前置和尾引号,你可能会得到“词汇或预处理问题:RestKit/RestKit”。h文件未找到“问题”。

#13


0  

This is a problem that I don't think has enough answers for this problem, because if you have this problem it feels like there is nothing to be done! After trying all of the proposed solutions (none of them worked). I finally found the problem

这是一个我认为没有足够的答案来解决这个问题的问题,因为如果你有这个问题,你会觉得没有什么可做的!在尝试了所有建议的解决方案之后(没有一个是有效的)。我终于找到了问题所在。

The problem was that one of my folders had a space in it. Don't use spaces in your source folder names!

问题是我的一个文件夹里面有个空格。不要在源文件夹中使用空格!

Used to be : (/Xcode projects/basicRestkit etc...)  -- lots of pain and suffering  
changed to : (/projects/basicRestkit) -- lots of rejoicing

This caused the header search paths not to work, and therefore not to find the files. There may very well be a way to use alter the header search paths to find your files even with spaces.

这导致头搜索路径不工作,因此不查找文件。很可能有一种方法可以使用alter header搜索路径来查找文件,即使是空格。

This might not help you, but it very well could. Good luck.

这可能对你没有帮助,但很有可能。祝你好运。

#14


0  

For me only these steps works. Check here Hope this will help.

对我来说,只有这些步骤有效。希望这对你有帮助。

#1


10  

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?

当您升级到0.10.0时,您将更改头搜索路径到“$(BUILT_PRODUCTS_DIR)/../..”/头”,对吧?

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.

目标设置仍然有旧的头搜索路径,不管出于什么原因,决定不从项目设置继承。

#2


3  

Mind you - its a total hack - but it got my project running.

请注意,这完全是一种黑客行为,但它让我的项目得以运行。

Assuming that you've already followed the installation steps from the RestKit Github https://github.com/RestKit/RestKit/blob/master/README.md#quick-start-aka-tldr

假设您已经遵循了RestKit Github https://github.com/restkit/restkit/restkit/blob/master/readme的安装步骤。

In the RestKit target, goto Build Phases. Under the Copy Headers dropdown, move all of the header files from "Project" to "Public".

在RestKit目标中,goto构建阶段。在拷贝头下拉下,将所有头文件从“项目”移到“公共”。

Clean, Build, Run.

干净、构建、运行。

#3


3  

Solution I found was not to copy and past the "$(BUILT_PRODUCTS_DIR)/../../Headers" to your target's Header Search Paths.

我发现的解决方案不是复制并通过“$(BUILT_PRODUCTS_DIR)/.. ..”/标题“到你的目标的头搜索路径。

After five hours I deleted the copy and pasted " and manually typed them in and it worked.

5个小时后,我删除了复制粘贴,然后手工输入,然后就成功了。

#4


2  

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.

我最近从RestKit 0.9.3升级到0.10.0,并且有相同的功能。您是否删除了RestKit/build目录?这包含了.h文件的副本,并作为构建过程的一部分创建,当构建0.9 x时。做产品->清洁似乎没有删除这些文件。0.10.0似乎没有创建这个构建目录。我怀疑您的构建错误是由于那些文件仍然被拾取。

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.

此外,为了充分回答您的问题,我将RestKit文件保存在:(project dir)/框架/RestKit中,这是一个git子模块,因此它包含了一个特定修订版本的RestKit git repo的克隆。

And the header search path is:
$(BUILT_PRODUCTS_DIR)/../../Headers

并且头搜索路径是:$(BUILT_PRODUCTS_DIR)/../../ header。

The header search path for 0.9.3 was:
$(SOURCE_ROOT)/RestKit/Build

0.9.3的头搜索路径是:$(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:

我发现这个指南很有用(也许这就是你已经在做的):https://github.com/restkit/restkit/wiki/installing-restkitin - xcode -4.x,并注意到只有libRestKit的部分。一个在最新的RestKit版本的项目中,早期版本都有:

  • libRestKitNetwork.a
  • libRestKitNetwork.a
  • libRestKitObjectMapping.a
  • libRestKitObjectMapping.a
  • libRestKitSupport.a
  • libRestKitSupport.a
  • libRestKitJSONParserJSONKit.a
  • libRestKitJSONParserJSONKit.a
  • libRestKitXMLParserLibxml.a
  • libRestKitXMLParserLibxml.a
  • libRestKitCoreData.a
  • libRestKitCoreData.a

If you have all of these, delete them from your project.

如果你有这些,把它们从你的项目中删除。

#5


2  

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).

在过去的几个小时里一直在和同一个问题斗争。最终对我起作用的是(我并不是说这是一个确定的解决方案,但至少它是可以尝试的)。

  • Delete RestKit from your Project
  • 从项目中删除RestKit。
  • Close your project
  • 闭上你的项目
  • Move the RestKit folder next to your main xcodeproject
  • 将RestKit文件夹移到主xcodeproject的旁边。
  • Open the RestKit project and build it
  • 打开RestKit项目并构建它。
  • Close the RestKit project
  • 关闭RestKit项目
  • Open your project, and re-import the RestKit project into your xcodeproject
  • 打开您的项目,并将RestKit项目重新导入到xcodeproject中。
  • Fix the Dependencies and Linkings in the target settings
  • 在目标设置中修复依赖项和Linkings。
  • Add the "$(BUILT_PRODUCTS_DIR)/../../Headers" search path to BOTH the project settings and the target settings. (it only worked for me when they were listed in both).
  • 添加“$(BUILT_PRODUCTS_DIR)/ . . / . ./标题“搜索路径到项目设置和目标设置。(只有当它们同时被列在两者中时,它才会起作用。)

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)

(我的设置是XCode 4.3.2和OS X 10.7.3)

#6


1  

After spending 2 days on this same error and navigating to every possibile google result I finally got it!

在同样的错误上花费了2天时间,并导航到每一个可能的谷歌结果,我终于得到了它!

It's not due to Derived Data settings, those are fine already in XCode 4.3.2.

这不是由于派生的数据设置,这些已经在XCode 4.3.2中已经很好了。

The problem is that you are doing a #import "RKObjectMapping.h" or some other include.

问题是您正在执行一个#import“RKObjectMapping”。h或其他的包括。

Instead use @class RKObjectMapping or if you really nead the .h use <RestKit/RKObjectMapping.h>

相反,使用@class RKObjectMapping,或者如果您真的nead .h使用

I went with @class since I just need to compile...

我使用@class,因为我只需要编译…

Hope this help!

希望这次的帮助!

#7


1  

Had this problem too. It would build and run just fine on simulator, but would not archive. Here's where I went wrong...

也有这个问题。它会在模拟器上运行良好,但不会存档。这是我出错的地方……

I did this:

我这样做:

#import "RestKit.h"

Rather than the correct way:

而不是正确的方法:

#import <RestKit/RestKit.h>

#8


0  

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.

我今天犯了同样的错误。我们所有的代码都在github repo中,而restkit文件夹被忽略了,所以restkit文件没有在其中。现在,当xcode打开这个项目并发现丢失的东西时,它假定所有的东西都被破坏了。所以,删除了文件夹,重新克隆了它,然后抓取了一个新的restkit拷贝并把它扔到那里,瞧,一切都成功了。

#9


0  

I found that I need to manually build the RestKit target for the header files to be copied into the build directory. Apparently the master project build does not reliably run the subproject build?

我发现我需要手动构建RestKit目标,以便将头文件复制到构建目录中。显然,主项目构建并不可靠地运行子项目构建?

So, my steps for fixing this issue:

所以,我解决这个问题的步骤是:

  • Select the RestKit run target
  • 选择RestKit运行目标。
  • Build
  • 构建
  • Make sure the header search path was set on all target (apparently on project itself is not enough)
  • 确保标题搜索路径设置在所有目标上(显然,项目本身是不够的)
  • Build main project
  • 构建的主要项目

#10


0  

Had a very similar problem. It turned out to be I had accidentally added the build setting to "User Header Search Paths" rather than "Header Search Paths".

有一个非常相似的问题。结果是,我意外地将构建设置添加到“用户头搜索路径”而不是“头搜索路径”。

#11


0  

My solution:

我的解决方案:

When adding "$(BUILT_PRODUCTS_DIR)/../../Headers" to Targets -> Build Settings -> Search Paths -> Header Search paths, the value was not set.

当添加“$(BUILT_PRODUCTS_DIR)/ . . / . ./标题“目标->构建设置->搜索路径->头搜索路径,值未设置。

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...

所以你点击标题搜索路径上的信息披露按钮。单击+符号右的属性并添加值…

#12


0  

Here's a common mistake that'll make you want to slap yourself after you fix it.

这是一个常见的错误,它会让你在修复之后想扇自己一巴掌。

Yes, you definitely do want to add "$(BUILT_PRODUCTS_DIR)/../../Headers" to your target's Header Search Paths, but don't forget to include the quotes!

是的,您确实需要添加“$(BUILT_PRODUCTS_DIR)/../..”/Header“到你的目标的头搜索路径,但是不要忘记包含引号!

I'm talking about the quotes that are before $(BUILT and after _DIR)/../../Headers

我说的是在$(构建和之后的_DIR)/../../ header之前的引号。

If your build configuration has a space in the name (e.g. mine is 'Ad Hoc') and you've just added $(BUILT_PRODUCTS_DIR)/../../Headers without the leading and trailing quotes, you may end up getting the "Lexical or Preprocessor issue: RestKit/RestKit.h file not found" problem.

如果您的构建配置有一个名称空间(例如,我的是“临时的”),而您刚刚添加了$(BUILT_PRODUCTS_DIR)/../..没有前置和尾引号,你可能会得到“词汇或预处理问题:RestKit/RestKit”。h文件未找到“问题”。

#13


0  

This is a problem that I don't think has enough answers for this problem, because if you have this problem it feels like there is nothing to be done! After trying all of the proposed solutions (none of them worked). I finally found the problem

这是一个我认为没有足够的答案来解决这个问题的问题,因为如果你有这个问题,你会觉得没有什么可做的!在尝试了所有建议的解决方案之后(没有一个是有效的)。我终于找到了问题所在。

The problem was that one of my folders had a space in it. Don't use spaces in your source folder names!

问题是我的一个文件夹里面有个空格。不要在源文件夹中使用空格!

Used to be : (/Xcode projects/basicRestkit etc...)  -- lots of pain and suffering  
changed to : (/projects/basicRestkit) -- lots of rejoicing

This caused the header search paths not to work, and therefore not to find the files. There may very well be a way to use alter the header search paths to find your files even with spaces.

这导致头搜索路径不工作,因此不查找文件。很可能有一种方法可以使用alter header搜索路径来查找文件,即使是空格。

This might not help you, but it very well could. Good luck.

这可能对你没有帮助,但很有可能。祝你好运。

#14


0  

For me only these steps works. Check here Hope this will help.

对我来说,只有这些步骤有效。希望这对你有帮助。