Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode Archive won't find header file in subproject

So frustrated with XCode right now. I can build and run from code perfectly fine. However, trying to archive is a disaster.

I created a project, then dragged the .xcodeproj into XCode on the project navigator. Shows up fine, cool. Parent project build settings:

Other linker flags: -all_load, -ObjC

Target Dependencies : CocoaLibSpotify (subproject I'm incorporating)

Link Binary with Libraries : libCocoaLibSpotify.a

When I build my project, the following lines work

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

However, when I archive, my project fails to find these files. It's worth noting that the subproject files aren't in the same directory as the parent project. However, isn't that the point of the target dependency/link binary with library? Why is it failing to archive? This seems like it should be a lot easier than it's being.

Thanks.

Edit: Errors from compiling

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.`
like image 595
LyricalPanda Avatar asked Nov 26 '12 15:11

LyricalPanda


1 Answers

Archive uses a different directory structure when building, which can be a pain. I've found success by adding the following to the User Header Search Paths build setting of your application's target:

"$(BUILD_ROOT)/../IntermediateBuildFilesPath/UninstalledProducts/include" (including the quotes).

Also, make sure Always Search User Paths is set to Yes.

In addition, I have $CONFIGURATION_BUILD_DIR/include in my Header Search Paths setting, but I don't think that'll help archiving.

like image 114
iKenndac Avatar answered Nov 16 '22 02:11

iKenndac