Xcode Archive将无法在子项目中找到头文件

时间:2012-11-26 15:42:22

标签: xcode cocoalibspotify-2.0

现在对XCode感到很沮丧。我可以完美地构建和运行代码。但是,尝试存档是一场灾难。

我创建了一个项目,然后将.xcodeproj拖到项目导航器上的XCode中。显示很好,很酷。父项目构建设置:

Other linker flags: -all_load, -ObjC

Target Dependencies : CocoaLibSpotify (subproject I'm incorporating)

Link Binary with Libraries : libCocoaLibSpotify.a

当我构建项目时,以下行工作

#import "CocoaLibSpotify.h"
#import <CocoaLibSpotify.h>

但是,当我存档时,我的项目无法找到这些文件。值得注意的是,子项目文件与父项目不在同一目录中。但是,这不是目标依赖/链接二进制文件与库的关键吗?为什么没有存档?这看起来应该比现在容易得多。

感谢。

编辑:编译错误

In file included from /Users/ericharmon/Projects/teamsync/teamsync/TeamSync/AppDelegate.m:12:  
In file included from  /Users/ericharmon/Projects/teamsync/teamsync/TeamSync/Classes/GUI/ViewControllers/LoginViewControll er.h:9:
In file included from /Users/ericharmon/Projects/teamsync/teamsync/TeamSync/Classes/GUI/BaseViewController.h:10:
In file included from /Users/ericharmon/Projects/teamsync/teamsync/TeamSync/Classes/Model/Managers/Managers.h:9:
In file included from /Users/ericharmon/Projects/teamsync/teamsync/TeamSync/Classes/Model/Managers/AppLogicManager.h:11:
In file included from   /Users/ericharmon/Projects/teamsync/teamsync/TeamSync/Classes/Model/CoreData/CoreDataObjects.h:13:
/Users/ericharmon/Projects/teamsync/teamsync/TeamSync/Classes/Model/CoreData/Track.h:13:9: fatal error: 'CocoaLibSpotify.h' file not found
#import <CocoaLibSpotify.h>
    ^
1 error generated.`

1 个答案:

答案 0 :(得分:15)

Archive在构建时使用不同的目录结构,这可能很痛苦。我通过将以下内容添加到应用程序目标的User Header Search Paths构建设置中来获得成功:

"$(BUILD_ROOT)/../IntermediateBuildFilesPath/UninstalledProducts/include"(包括引号)。

另外,请确保Always Search User Paths设置为Yes

此外,我在$CONFIGURATION_BUILD_DIR/include设置中Header Search Paths,但我认为这不会有助于存档。