Simplified Xcode 4 Installation & Fix for Archive Build

408 views
Skip to first unread message

Blake Watters

unread,
Mar 18, 2011, 8:02:20 AM3/18/11
to res...@googlegroups.com
Alrighty, I have drilled into Xcode 4's build process changes in more depth and tackled the Archive build issue. Here is the news:

- By embracing the derived data directory and checking out the include paths set by Xcode 4, I have eliminated the install steps around the Header Search Path and Library Search Path. If you are using Derived Data builds you can just add the project reference, linker flags, and link the static libs into your target and you are off to the races.
- Non derived data builds now work exactly like XCode 3.x

I have reworked the header protection scripts and worked around the breakage in Build & Archive. Should be nicer now. If somebody else can pull and verify that would be awesome.

- Blake

Blake Watters
Two Toasters | CTO

David Steinberger

unread,
Mar 18, 2011, 10:11:54 AM3/18/11
to res...@googlegroups.com
Thanks so much! Will do it tonight.

QQ: is this merged into branch 0.9?

2011/3/18 Blake Watters <bl...@twotoasters.com>

Adam Williams

unread,
Mar 18, 2011, 11:21:37 AM3/18/11
to res...@googlegroups.com
Blake, thank you for working through this very important issue!

I have, I believe, followed the directions for a 'derived data' Build Location to a tee, and cannot get it to archive. This is Xcode 4, of course.

In the 'Build target RestKit', the Copy RestKit.h goes off without a hitch, but after that step, the following two steps appear to 'fail':

---------------
PhaseScriptExecution "Protect Copied Headers" .....
/bin/sh -c /Users/aiwilliams/Library/Developer/Xcode/DerivedData/DreamCake-gcimooiqbxprevhcpvycbmhzseex/ArchiveIntermediates/DreamCake/IntermediateBuildFilesPath/RestKit.build/Release-iphoneos/RestKit.build/Script-25956980126DF159004BAC4C.sh

Configuration include path does not exist, likely perform a Build & Archive operation...
---------------

---------------
PhaseScriptExecution "Copy Headers to Legacy Location" ......
/bin/sh -c /Users/aiwilliams/Library/Developer/Xcode/DerivedData/DreamCake-gcimooiqbxprevhcpvycbmhzseex/ArchiveIntermediates/DreamCake/IntermediateBuildFilesPath/RestKit.build/Release-iphoneos/RestKit.build/Script-250F87BE13337518002F4590.sh

Configuration include path does not exist, likely perform a Build & Archive operation...
---------------

It then goes into the 'Build target DreamCake', does it's thing fine until it attempts to compile one of my project files which does '#include <RestKit/RestKit.h>', at which point:

---------------
CompileC /Users/aiwilliams/Library/Developer/Xcode/DerivedData/DreamCake-gcimooiqbxprevhcpvycbmhzseex/ArchiveIntermediates/DreamCake/IntermediateBuildFilesPath/DreamCake.build/Release-iphoneos/DreamCake.build/Objects-normal/armv6/DBStopLocation.o Code/Models/DBStopLocation.m normal armv6 objective-c com.apple.compilers.gcc.4_2
.....
In file included from /Users/aiwilliams/Workspaces/dreamcakes/iphone/Code/Models/DBStopLocation.m:1:
/Users/aiwilliams/Workspaces/dreamcakes/iphone/Code/Models/DBStopLocation.h:2:28: error: RestKit/RestKit.h: No such file or directory
.....
---------------


Any thoughts would be greatly appreciated.

Adam Williams

Blake Watters

unread,
Mar 19, 2011, 2:37:15 AM3/19/11
to res...@googlegroups.com, Adam Williams
Adam -

Thanks for checking this out. I tried applying the changes to an existing client project today and wound up in serious build hell. All new projects and example projects on my box seem to be working fine, but obviously something isn't there yet. 

If you get a moment, can you try doing a build and archive on the RKTwitter project on 0.9? I sniff tested the changes on that project this morning. Curious if it works for others.

I'll advise on this issue this weekend. Xcode 3 vs. Xcode 4 + archiving issues are causing a lot of heartburn around the Two Toasters office atm, so I'll continue fighting this one before pushing forward on the rest of the 0.9.1 list.

- Blake

gotoanddevelop

unread,
Mar 19, 2011, 5:48:07 AM3/19/11
to RestKit
I just downloaded the latest build and followed your instructions to
the letter for the simplified xcode 4 install and it works fine. Great
job
>  *Blake Watters*

Adam Williams

unread,
Mar 19, 2011, 10:28:16 AM3/19/11
to Blake Watters, res...@googlegroups.com
On Mar 19, 2011, at 2:37 AM, Blake Watters wrote:

> Thanks for checking this out. I tried applying the changes to an existing client project today and wound up in serious build hell. All new projects and example projects on my box seem to be working fine, but obviously something isn't there yet.

Whew. I was starting to think that I'm not cut out for this kind of work :)

> If you get a moment, can you try doing a build and archive on the RKTwitter project on 0.9?

Build and Archive reports 'Archive Succeeded'.

At this point, I don't know how to turn that into an ipa for uploading to testflightapp.com. When I press 'Validate...' or 'Submit...', it tells me that the archive 'does not contain a single-bundle application' and that I should adjust the scheme to create one. When I press 'Share...', I'm given options to produce a couple of things, but I cannot choose 'Package', and the Identity selector tells me 'This kind of archive cannot be signed'.

> I'll advise on this issue this weekend. Xcode 3 vs. Xcode 4 + archiving issues are causing a lot of heartburn around the Two Toasters office atm, so I'll continue fighting this one before pushing forward on the rest of the 0.9.1 list.

You're very gracious. I burned almost all of Friday tweaking things to no avail. Obviously, something is not right in my project's configuration... I just don't know how to determine what that is. I'm not in Ruby anymore :)

Adam Williams

Blake Watters

unread,
Mar 19, 2011, 11:18:10 AM3/19/11
to Adam Williams, res...@googlegroups.com
The build permutations with Xcode are mind boggling and case be totally frustrating. Yesterday we finished up testing a build of a Go Try It On and were ready to go to the app store, only to find that the entire build setup was completely fucked on Distribution but not Debug/Release. After 2 hours of fighting I had to go back to Xcode 3 so we could ship the damned thing.

In any case, I'll share the wisdom once I sort this out on our projects.

dave84

unread,
Mar 20, 2011, 7:37:37 AM3/20/11
to RestKit
I admit to have not really understood everything in XCode 4.
But even my attempts to archive the RKTwitter example are failing. Do
others experience the same?
>  *Blake Watters*

dave84

unread,
Mar 20, 2011, 1:01:40 PM3/20/11
to RestKit
Update to my post above: I can archive RKTwitter and my app with 0.9
branch of RestKit.
But I cannot export the ipa file. When I try to validate it in the
organizer I get:

[project] does not contain a single–bundle application or contains
multiple products. Please select another archive, or adjust your
scheme to create a single–bundle application.

Any idea?

Andrew Newdel

unread,
Mar 20, 2011, 1:23:25 PM3/20/11
to RestKit
There's a thread and possible solution for this "single-bundle" issue
on the Apple dev forums.

https://devforums.apple.com/message/398031

Look for the reply from "kak" that starts with "SUCCESS!".

I haven't tried it with RestKit, but it worked for me with another
library.

David Hopkinson

unread,
Mar 21, 2011, 7:40:29 AM3/21/11
to RestKit
I have tried to follow the instructions to set up RestKit with xcode 4
(multiple times!) and I seem to be getting nowhere. Have things
changed - are there any updated instructions?

I have been getting project inconsistencies and xcode crashes when
adding the RestKit target. If I do get beyond that point it does not
seem to build the dependancies correctly (probably to do with derived
paths etc).

I may be being a bit of an idiot with all this (relative newby) but
any help on pointers in the right direction would be appreciated,

Thanks

David
>  *Blake Watters*

David Steinberger

unread,
Mar 21, 2011, 7:49:46 AM3/21/11
to res...@googlegroups.com
Kinda same here. With the 0.9 branch I got pretty far, but even here the archiving fails.

Also strange is that when I drag&drop the RestKit project onto my project I don't get asked what I want to do (as in the readme).
I need to restart Xcode only to be able to open the RestKit project. I start to hate Xcode 4.

Whenever I get somewhere I will report back.

2011/3/21 David Hopkinson <david.h...@gmail.com>

gotoanddevelop

unread,
Mar 21, 2011, 8:11:24 AM3/21/11
to RestKit
Let me see if I can help.

I had the same problem. Xcode didnt ask me about copy vs reference but
don't let that put you off.

Make sure you have the correct project downloaded with the simplified
project. You can confirm this by opening the readme file, it should
not have the steps for headers search path etc anymore.

When you drag in the project file in it should end up looking like a
sub project, almost like it copied the files in but if you check in
finder you will see it didn't! If you cannot expand/collapse the
restkit project within your project try restarting Xcode and see if
that fixes it.

Once you see restkit in your project and you can expand/collapse it
then you should just follow the instructions in the readme.

This worked for me. As the Git page stands. you just skip steps 8 and
9.

Hope this helps someone.



On Mar 21, 11:49 am, David Steinberger <mail.steinber...@gmail.com>
wrote:
> Kinda same here. With the 0.9 branch I got pretty far, but even here the
> archiving fails.
>
> Also strange is that when I drag&drop the RestKit project onto my project I
> don't get asked what I want to do (as in the readme).
> I need to restart Xcode only to be able to open the RestKit project. I start
> to hate Xcode 4.
>
> Whenever I get somewhere I will report back.
>
> 2011/3/21 David Hopkinson <david.hopkin...@gmail.com>

David Hopkinson

unread,
Mar 21, 2011, 8:25:31 AM3/21/11
to RestKit
OK. Should I clone out the 0.9 version instead of having the
submodule? Looks like I have the wrong version.

gotoanddevelop

unread,
Mar 21, 2011, 8:33:09 AM3/21/11
to RestKit
Try this

https://github.com/twotoasters/RestKit/commit/2109fae1ba3ab79debe0b51e26674d5497c19b4f

I got the url from Blake's most recent tweet. I must admit I just
download through the browser, I don't really understand the git
submodule thing. Perhaps someone could explain?

On Mar 21, 12:25 pm, David Hopkinson <david.hopkin...@gmail.com>
wrote:

David Steinberger

unread,
Mar 21, 2011, 9:18:34 AM3/21/11
to res...@googlegroups.com
Is archiving working for you?

To test, please archive and try to validate & sign the archive in the organizer.
I got to a point where I could archive, but cannot create a signed ipa.

2011/3/21 gotoanddevelop <chri...@gmail.com>

Adam Williams

unread,
Mar 21, 2011, 9:29:03 AM3/21/11
to res...@googlegroups.com
Git submodules are only useful if you are yourself using Git for version control of your own project. If this is the case, you may understand submodules as a 'contained' repository. When you add a submodule to your Git-managed project, you are indeed instructing Git to clone another repository, placing it in the location specified when you invoke the "git submodule add" command. Then, when you make a commit into your own repository that includes the newly added submodule, you are simply storing a pointer to the url of the Git submodule (contained repository) as well as the ref that is the version of that submodule that you want to have in your project. That way, when other folks clone your project, they can do "git submodule update --init" to fetch the correct versions of the files for the submodule. In fact, since this submodule is simply another Git repo, you may cd into the directory you cloned into (<project>/RestKit if you follow the instructions) and use regular git commands, including "git branch 0.9 origin/0.9 && git checkout 0.9" in order to utilize that code.

The value in all of this is that you may track the changes of a dependency. In this case, when Two Toasters pushes new code into master, or 0.9, or whatever branch you are tracking in the submodule, you can simply cd into the submodule directory and do a "git pull", then commit the updated pointer that your own project reflects due to the updated submodule.

Hope that helps,

Adam Williams

gotoanddevelop

unread,
Mar 21, 2011, 10:02:52 AM3/21/11
to RestKit
Wow, thanks Adam. Lots of great information.

David, I will have to try it tonight. I have not got that far in my
app development yet.

On Mar 21, 1:29 pm, Adam Williams <a...@thewilliams.ws> wrote:
> Git submodules are only useful if you are yourself using Git for version control of your own project. If this is the case, you may understand submodules as a 'contained' repository. When you add a submodule to your Git-managed project, you are indeed instructing Git to clone another repository, placing it in the location specified when you invoke the "git submodule add" command. Then, when you make a commit into your own repository that includes the newly added submodule, you are simply storing a pointer to the url of the Git submodule (contained repository) as well as the ref that is the version of that submodule that you want to have in your project. That way, when other folks clone your project, they can do "git submodule update --init" to fetch the correct versions of the files for the submodule. In fact, since this submodule is simply another Git repo, you may cd into the directory you cloned into (<project>/RestKit if you follow the instructions) and use regular git commands, including "git branch 0.9 origin/0.9 && git checkout 0.9" in order to utilize that code.
>
> The value in all of this is that you may track the changes of a dependency. In this case, when Two Toasters pushes new code into master, or 0.9, or whatever branch you are tracking in the submodule, you can simply cd into the submodule directory and do a "git pull", then commit the updated pointer that your own project reflects due to the updated submodule.
>
> Hope that helps,
>
>    Adam Williams
>
> On Mar 21, 2011, at 8:33 AM, gotoanddevelop wrote:
>
> > Try this
>
> >https://github.com/twotoasters/RestKit/commit/2109fae1ba3ab79debe0b51...

Blake Watters

unread,
Mar 21, 2011, 11:01:18 AM3/21/11
to res...@googlegroups.com
Ugh, this Xcode 4 switch has been nothing but pain. I think I am just
going to add a new build target that will create a framework or set of
fat binaries for the libs. We are seeing wildly different behavior from
app to app across Two Toasters projects. I'll take another look at this
mess tonight.

On 3/20/11 1:23 PM, Andrew Newdel wrote:
> There's a thread and possible solution for this "single-bundle" issue
> on the Apple dev forums.
>
> https://devforums.apple.com/message/398031
>
> Look for the reply from "kak" that starts with "SUCCESS!".
>
> I haven't tried it with RestKit, but it worked for me with another
> library.
>
>
> On Mar 20, 1:01 pm, dave84<mail.steinber...@gmail.com> wrote:
>> Update to my post above: I can archive RKTwitter and my app with 0.9
>> branch of RestKit.
>> But I cannot export the ipa file. When I try to validate it in the
>> organizer I get:
>>

>> [project] does not contain a single�bundle application or contains


>> multiple products. Please select another archive, or adjust your

>> scheme to create a single�bundle application.

David Steinberger

unread,
Mar 21, 2011, 11:23:47 AM3/21/11
to res...@googlegroups.com
Blake,

I'm not really experienced, but shouldn't we have a look on how three20 is doing it?
They have it modularized and from what I can say it works pretty well in Xcode 4 (since rel 1.0.5).

2011/3/21 Blake Watters <bl...@twotoasters.com>
Ugh, this Xcode 4 switch has been nothing but pain. I think I am just going to add a new build target that will create a framework or set of fat binaries for the libs. We are seeing wildly different behavior from app to app across Two Toasters projects. I'll take another look at this mess tonight.


On 3/20/11 1:23 PM, Andrew Newdel wrote:
There's a thread and possible solution for this "single-bundle" issue
on the Apple dev forums.

https://devforums.apple.com/message/398031

Look for the reply from "kak" that starts with "SUCCESS!".

I haven't tried it with RestKit, but it worked for me with another
library.


On Mar 20, 1:01 pm, dave84<mail.steinber...@gmail.com>  wrote:
Update to my post above: I can archive RKTwitter and my app with 0.9
branch of RestKit.
But I cannot export the ipa file. When I try to validate it in the
organizer I get:

[project] does not contain a single–bundle application or contains

multiple products. Please select another archive, or adjust your
scheme to create a single–bundle application.

ericnewman

unread,
Apr 8, 2011, 2:03:26 PM4/8/11
to RestKit
Just Curious, is this really fixed in XCode 4.0.1 now? I've removed
and re-added the RestKit project using the latest build, and removed
references to the path in the Headers preferences. I'm still getting
errors from every place that imports <Restkit/Restkit.h>. I'm a bit
confused as to which set of instructions I should be following in the
read me at this point. Can you clarify a) That it should now archive,
and b) Which installation procedure is correct? and c) Are static
libraries in or out now? I've seen conflicting info... When I add them
I seem to just get even more errors...

Blake - this stuff is awesome, and I couldn't live without it, but Im
in the process of re-installing XCode 3 just to get a build out...

Thanks!

Blake Watters

unread,
Apr 8, 2011, 7:32:02 PM4/8/11
to res...@googlegroups.com, ericnewman
Eric -

The instructions for Xcode 4 should be working fine. We are linking against static libraries and the only Header search path you need is RestKit/Build non-recursive. Make sure that you don't have this duplicated on your project & target somehow and clear out the Build directory and DerivedData directory if you are running into weirdness. Generally if you see problems on the import its because its picking up duplicate copies of the headers from somewhere and they collide.

Something else that could be helpful is to start from a clean project and walk through the install and see it work on a clean project. Then you can compare your settings windows.

I know this stuff has been a real pain in the ass -- I've lost so many hours with Xcode 4 related non-sense. I have Xcode 4 templates to push later this weekend that should help.

If you get really stuck, you can shoot me a project off-list and I can peak at it.

- Blake

curylo

unread,
Apr 12, 2011, 4:00:42 PM4/12/11
to RestKit
Anyone good at RestKit available to consult?

I inherited some code from someones project using Restkit ... which
was OK... until new OS4 changes...
I can't really follow this and don't have time to learn it well.

I bet it would take a couple hours for someone who knows what is up to
get it working and linked properly.
Plus... We might extend some more consulting work / project work.

So we could do something hourly or project (project 1 would be getting
it to Archive into an ipa ... I can build it and run it.. and debug
it... but not archive it) then proejct 2 (change the XML POST/GET
format for us)

You could do a video of it or an ad hoc ipa ... then we pay then you
send the properly linked code?

Thanks,
Michael Curylo
mic...@moikkacompany.com
817.938.7401
>  *Blake Watters*
Reply all
Reply to author
Forward
0 new messages