所有 RestKit 项目在归档时都无法构建

发布于 2024-12-18 14:26:54 字数 1559 浏览 1 评论 0原文

此问题涉及 RESTKIT 0.9.x。

如果您不熟悉 RESTKIT,请考虑使用较新的 0.10.x 分支.

我最近继承了一个使用 的项目 (restkit.org)。我已经开始使用分支(402-new-build-process) 与

我的项目和所有示例项目都构建并运行,但是当涉及到存档应用程序时,构建失败:

/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 - 无法存档Rest Kit 示例项目

我已遵循项目 wiki 上的安装故障排除指南 ,但这没有用。

根据 Blake 的回答,我正在构建 DerivedData 目录:

DerivedData 目录设置

另外,我尝试将标头搜索设置为这些(在许多组合中[只是猜测]):

“$(BUILD_DIR)/RestKit/Build”
“$(SOURCE_ROOT)/RestKit/Build”
“$(SOURCE_ROOT)/../../构建”
“$(BUILD_DIR)/../../构建”

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

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"

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(8

蓝眼睛不忧郁 2024-12-25 14:26:54

我认为所有这些修复都是在黑暗中进行的,或者至少对我来说是这样的。我有点期待读到一篇关于从一位年轻处女那里获取一些头发并在 Mac 上烧掉的内容。

如果它在开发中为您编译,但不为存档编译,那么它肯定很简单。或者至少对我来说是这样。

我的源文件不在正确的位置:

搜索标头设置为“$(SOURCE_ROOT)/RestKit/Build”,

但我只是将 proj 文件从下载位置拖到 XCode 中。在编译调试等时,这从来都不是问题。只是在存档时,所以我有一段时间没有发现它。

只需确保 RestKit/Build 的路径就是实际文件所在的位置。

为我修复了它,与我读过的所有交叉手指修复不同。就像将标题移动到一个组中等等......那真是一堆垃圾。

祝你好运,希望这有帮助。感谢 Restkit 团队,这确实是一个很棒的框架。

杰米

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

始终不够爱げ你 2024-12-25 14:26:54

我正在针对 development 分支进行构建,并将 RestKit 作为子模块集成到我的根 git 文件夹中,

+ root project folder
|--+ RestKit
|--+ <Projectname> 
   |--+ <Projectname>.xcodeproj

因此我使用以下搜索路径

"$(BUILT_PRODUCTS_DIR)/../../Headers"
"$(SOURCE_ROOT)/../RestKit/Build"

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"
╄→承喏 2024-12-25 14:26:54

!!!更新到分支最新版本!!!

我刚刚在 Xcode 4.2 上将 RKCatalog 和 RKTwitterCoreData 构建为存档,没有出现任何问题。由于代码签名问题,我失败了。您是否确认正在使用 DerivedData 目录进行构建:

RestKit 假设您正在使用构建到 DerivedData 目录的现代 Xcode 项目。确认您的设置
通过“文件”菜单> “项目设置...”。在打开的工作表中的“构建”选项卡上,单击“高级...”
按钮并确认您的“构建位置”是“派生数据位置”。

我可以推送将标头 rsync 到已知位置的更改,但我希望 DerivedData 的标准化能够简化该过程。

!!!Update to the latest version of the branch!!!

I've just built RKCatalog and RKTwitterCoreData as an archive on Xcode 4.2 without issue. I am failing due to a Code Signing issue. Have you confirmed that you are building with the DerivedData directory:

RestKit assumes that you are using a modern Xcode project building to the DerivedData directory. Confirm your settings
via the "File" menu > "Project Settings...". On the "Build" tab within the sheet that opens, click the "Advanced..."
button and confirm that your "Build Location" is the "Derived Data Location".

I can push changes that rsync the headers to a known location, but I was hoping that standardizing on DerivedData would simplify the process.

内心激荡 2024-12-25 14:26:54

重申 Jamie Reynolds 的答案,大多数(如果不是全部)都将标头搜索路径设置为“$(SOURCE_ROOT)/RestKit/Build”,这在调试时很好,也适合存档,当然除非你的 Restkit 框架是实际上就在这个目录下。

像你们大多数人一样,您可能刚刚从默认下载目录链接到框架,在这种情况下,转到 finder,打开 Restkit->Build cmd+i 以查看信息并选择目录路径,复制并替换“$(SOURCE_ROOT)/RestKit/Build”,不要忘记括号。

我的是“/Users/edwin-b/Downloads/RestKit-RestKit-8d0d9fc/Build”,效果非常好

To reiterate Jamie Reynolds answer, most (if not all) of you have set your header search paths to "$(SOURCE_ROOT)/RestKit/Build", this is fine while debugging and also fine for archiving, unless of course your Restkit framework IS actually in this directory.

Like the majority of you out there, you have probably just linked to the framework from the default download directory, in which case go to finder, open Restkit->Build cmd+i to see the info and select the directory path, copy and replace "$(SOURCE_ROOT)/RestKit/Build", dont forget the brackets.

mine was "/Users/edwin-b/Downloads/RestKit-RestKit-8d0d9fc/Build" worked like a charm

看春风乍起 2024-12-25 14:26:54

我按照几个 SO 答案中概述的步骤进行操作,问题最终是标题搜索路径的问题。在 XCode 4.2 中添加 RestKit 和尝试在 XCode 4.3.1 中存档之间的某个时间(我在启动项目和提供构建之间更新了两次),头搜索路径列表中注入了一个逗号,Xcode 无法再解析该逗号。结果,RestKit 的标头位置的条目是:

"$(SOURCE_ROOT)/RestKit/Build", 

当它应该是:

"$(SOURCE_ROOT)/RestKit/Build"

虽然这不会产生任何构建设备或 sim 的问题,但一旦我尝试存档,它就会导致 OP 报告的错误。

I followed the steps outlined in several SO answers, and the issue ended up being a problem with the Header Search Paths. Sometime between adding RestKit in XCode 4.2 and trying to archive in XCode 4.3.1 (I had updated twice between starting the project and providing a build), a comma had been injected in the Header Search Path list which Xcode could no longer parse. As a result, the entry for RestKit's header location was:

"$(SOURCE_ROOT)/RestKit/Build", 

When it should have just been:

"$(SOURCE_ROOT)/RestKit/Build"

While this didn't produce any issues building to device or sim, once I tried to archive, it caused the error reported by the OP.

静赏你的温柔 2024-12-25 14:26:54

只需将“$(SOURCE_ROOT)/RestKit/Build”添加到您的目标“标题搜索路径”即可,感谢这个回答

Just add "$(SOURCE_ROOT)/RestKit/Build" to you target "Header Search Paths", Thanks to this answer.

恋你朝朝暮暮 2024-12-25 14:26:54

我确信其中一些是多余的,但我只花了 3 个多小时来调试这个东西,并且在这个过程中几乎毁了我的项目。所以...给你了。

为了你的理智,在搞乱 RestKit 项目路径之前创建你的项目的 zip 备份,将所有文件(尤其是项目)提交到源代码管理,祈祷,在你的 mac 上烧掉一根处女头发,然后继续。

一一消除后,我将范围缩小到这一行,以便我进行存档。
“$(SOURCE_ROOT)/../RestKit/Build”
Restkit是与主项目文件夹同级的文件夹

solution

I'm sure some of these are redundant, but I just spent over 3 hours debugging this thing and almost ruined my project in the process. So... Here you have it.

For the sake of your sanity, create a zip backup of your project before messing with RestKit project paths, commit all files (especially the project) to source control, cross your fingers, burn a virgin hair over your mac, then proceed.

After eliminating them one by one, I narrowed it down to this line allowing me to archive.
"$(SOURCE_ROOT)/../RestKit/Build"
Restkit is a folder at the same level as the main project folder

solution

岁月蹉跎了容颜 2024-12-25 14:26:54

我添加这个答案是为了以后可以找到它 - 它与上面的一些回复相匹配。查看您的目标“标题搜索路径” - 并根据您的restkit目录在项目中的位置,添加上面在Alex Stones答案中指定的行之一。就我而言,它是“$(SOURCE_ROOT)/../RestKit/Build”

I'm adding this answer so I can find it later - it matches some responses above. Look in your targets "Header Search Paths" - and depending on where your restkit directory is in your project, add one of the lines specified above in Alex Stones answer. In my case, it was "$(SOURCE_ROOT)/../RestKit/Build"

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文