In Xcode 3.2.5 I use "Build And Archive" to create an IPA file without any problems. How can I do that in Xcode 4? I think I have to use "Product -> Archive", but I get over 100 error messages in the three20 framework. Most are "No such file or directory". ("Product -> Build For -> Build For Archiving" works. No errors.)
For example, this is the first error message:
../scripts/Protect.command: line 23: cd: /Users/[USERNAME]/Library/Developer/Xcode/DerivedData/[PROJECTNAME]-blabla/ArchiveIntermediates/[PROJECTNAME]/BuildProductsPath/Release-iphoneos/../three20/Three20Core: No such file or directory
The path "/[PROJECTNAME]/BuildProductsPath/three20/"
really doesn't exists, but this path exists: "/[PROJECTNAME]/three20/"
What can I do?
I'm looking into this right now and will hopefully put together an adequate patch that works in both Xcode 3.2.# and Xcode 4.
Edit: So it looks like the easiest way to get old Xcode 3.2 projects to work with Xcode 4 is to do the following:
I'll write up a three20.info article going into more details about this.
Make sure your scheme name doesn't contains spaces. That also leads to the "File not found" build error.
Google Groups: Xcode 4, Three20 and Project -> Archive
http://groups.google.com/group/three20/browse_frm/thread/cde36b7dab178bad
If you want a quick workaround, just do next simple steps:
1. go to the mentioned
/Users/[USERNAME]/Library/Developer/Xcode/DerivedData/[PROJECTNAME]-blabla/ArchiveIntermediates/[PROJECTNAME]/BuildProductsPath/
path (it will be in your error message). It should be a substring till/..
in that path.2. create
Release-iphoneos
(orDebug-iphoneos
if appropriate) folder thereThen everything will build fine!
Three20 script assumes you already have that folder, but when you build first time there is no one exists. That's why you need to fix "Build" and "Archive" separately: "Build" action usually uses
Debug-iphoneos
folder and "Archive" action usesRelease-iphoneos
.Tip: you can create all the required folders at once to avoid problems with different configurations. These are:
Release-iphoneos
Debug-iphoneos
Release-iphonesimulator
Debug-iphonesimulator
I did the following to make it work for me:
Absolute path
toproducts directory
.and that was it!
hint: to get an idea of the offending files that's causing your archive to create an archive file rather than an ipa do this:
usr/local/include
will identify the culprit header files you need to move from Public to Project or the files that you have to change from absolute path to products directory. but that directory (ie usr/local/include) varies depending on your sublibrary directory structureAmir Naor's answer is perfect. I verified his answer on xcode 4.2 and it worked. I missed the step "You will need to change the scripts as Manni mentioned above" so I kept getting the similar error as quoted in the original question post. hope you don't make the same mistake. also as of xcode 4.2, the step "then you will also need to change the "Locations" preference in Xcode as featherless mentioned above." isn't needed any more.