编译,构建或存档Xcode 4(和依赖) [英] Compile, Build or Archive problems with Xcode 4 (and dependencies)

查看:213
本文介绍了编译,构建或存档Xcode 4(和依赖)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题在过去几个星期已经演变,涵盖了更多的一般性问题: xcode4 (以及升级项目从旧 xcode )。

This question has evolved over the past several weeks to cover more general issues with xcode4 (and upgrading projects form older xcodes).

但是,许多问题可以通过遵循相同的说明来解决。

However many of the issues can be solved by following the same set of instructions.

如果您遇到以下任何问题,请尝试接受的答案中的方法:

If you have any of the following issues, try the methods in the accepted answer:


  • Xcode 4无法归档应用程序

  • Xcode 4创建不可用的归档文件

  • Xcode 4不创建.ipa


  • Xcode 4无法找到标题

  • Xcode 4的代码完成无效

  • 项目依赖项将无法编译

  • 添加依赖项会导致上述任何问题

  • Xcode 4 fails to archive an App
  • Xcode 4 creates an unusable archive
  • Xcode 4 does not create an .ipa
  • Xcode 4 fails to compile due to preprocessor errors
  • Xcode 4 cannot find headers
  • Xcode 4's code complete is not working
  • Project dependancies won't compile
  • Adding a dependancy causes any of the above issues

标题:在Xcode 4中找不到词汇或预处理器问题文件

Title: "lexical or preprocessor issue file not found" in Xcode 4

我有一个项目在Xcode 4,将构建精良,运行在设备和模拟器,但当试图归档它的错误,当寻找与静态库相关联的头文件:

I have a project in Xcode 4 that will build fine and run on the device and simulator but when trying to Archive it errors when looking for headers files associated with a static library:

In file included from /Volumes/Development/Path/LBProject/LBProject/LBProject-Prefix.pch:15:
In file included from /Volumes/Development/Path/LBProject/LBFDefines.h:23:
In file included from /Volumes/Development/Path/LBProject/Classes/LBProjectAppDelegate.h:11:
In file included from /Volumes/Development/Path/LBProject/LBProject/../FKNDirectory/FKNDirectoryManager.h:10:
/Volumes/Development/Path/LBProject/LBProject/../FKNDirectory/FKNDataModel.h:11:9: fatal error: 'Merchant.h' file not found [1]
 #import "Merchant.h"
         ^
1 error generated. 

Xcode给出错误

lexical or preprocessor issue file not found 

> Google搜索显示很多人都有这个问题,但没有解决方案。任何人都得到了一个解决或甚至一个线索。

Much Googling has show many people are having this issue but no solution. Anyone got a fix or even a clue.

更新: 用户标题搜索路径设置为 $ {BUILT_PRODUCTS_DIR} 。它使用任何配置构建良好,除非归档。

Update: The user header search paths are set to ${BUILT_PRODUCTS_DIR} in all configurations. It builds fine using any configuration except when archiving.

更新2: Merchant.h 是一个核心数据类,生成并因此在 .xcdatamodeld 包中,但是头文件都被复制到公共头文件目录当库构建。

Update 2: Merchant.h is a Core Data class that is auto-generated and therefore inside .xcdatamodeld package, however the headers are all copied to the public headers directory when the library is built.

推荐答案


注意:下面的步骤将解决90%的Xcode存档问题
然而,请尝试退出Xcode
先。




  1. 检查用户头路径

  2. 将始终搜索用户路径设置为YES

  3. 创建在您的项目中调用索引标头并将标题拖动到此群组中,在提示时,不要添加到任何目标。这包括您的 .xcdatamodeld 中的任何标题,您需要右键单击并查看包内容以找到它们。

  4. 对于所有依赖项,将跳过安装构建设置设置为

  5. 将建立阶段中的任何「公开」标题移至「专案」

  6. 将您目标上的建置设定安装目录设为 $ (LOCAL_APPS_DIR)

  7. 将目标构建设置扫描包含的所有源文件更改为YES。 (链接) / li>
  8. 对于较新版本的Xcode(> 4.2),您可能需要
  9. 手动操作 ://stackoverflow.com/a/6356862/89035>删除project.xcworkspace文件形成所有引用的项目

  1. Check the "user header paths" are correct (Add "" to paths for spaces, both in your project and dependencies)
  2. Set "Always search user paths" to YES
  3. Create a group call "Indexing headers" in your project and drag the headers to this group, DO NOT add to any targets when prompted. This includes any headers inside your .xcdatamodeld, you'll need to right-click and view package contents to find them.
  4. For all dependencies set "Skip Install" build setting to "Yes"
  5. Moving any "Public" headers in Build Phases to "Project"
  6. Set the Build Setting "Installation Directory" on your Target to $(LOCAL_APPS_DIR)
  7. Change the target build setting "scan all source files for includes" to YES. (link)
  8. With newer versions of Xcode (> 4.2) you might want to read this question related to workspaces.
  9. Manually delete the project.xcworkspace files form all referenced projects

这篇关于编译,构建或存档Xcode 4(和依赖)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆