Reputation: 11148
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?
Upvotes: 14
Views: 15690
Reputation: 171
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
(or Debug-iphoneos
if appropriate) folder there
Then 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 uses Release-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
Upvotes: 0
Reputation: 23548
I did the following to make it work for me:
Absolute path
to products 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 structureUpvotes: 0
Reputation: 2246
The Three20 documentation did not solve this issue for me (unfortunately...). Eventually what worked for me was a mix of a few solutions. There is a difference between "Archive" and "Build for Archiving" (or build for run) and using these steps I have both of them working with no build issues:
You will need to change the scripts as Manni mentioned, set the "Skip Install" flag for each Three20 project linked to your project tree and add the following paths to your project's "Header search paths":
"$(BUILT_PRODUCTS_DIR)/../three20" "$(BUILT_PRODUCTS_DIR)/../../three20"
this will get you to work with the Build option. When you want to perform the archive action, then you will also need to change the "Locations" preference in Xcode as featherless mentioned above.
I documented these steps in this post.
Upvotes: 16
Reputation: 8300
I had to go under Project Info > Build (tab) and add the following to the header search path:
three20/Build/Products/three20
This path may be specific to my project, but there it is in case it works for someone else.
Upvotes: 1
Reputation: 932
Make sure your scheme name doesn't contains spaces. That also leads to the "File not found" build error.
Upvotes: 2
Reputation: 155
Amir 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.
Upvotes: 0
Reputation: 1506
Another thing that could throw off the build process is using a scheme name that contains spaces.
XCode won't stop you from doing it, but if you use a name like "Ad Hoc" for your scheme, you'll end up the same errors:
Three20/Three20+Additions.h: No such file or directory
Upvotes: 5
Reputation: 11148
Google Groups: Xcode 4, Three20 and Project -> Archive
http://groups.google.com/group/three20/browse_frm/thread/cde36b7dab178bad
Upvotes: 0
Reputation: 11148
Open the file /src/common/Configurations/Paths.xcconfig
old code:
HEADER_SEARCH_PATHS = $(STDLIB_HEADERS) "$(CONFIGURATION_BUILD_DIR)/../three20"
new code:
HEADER_SEARCH_PATHS = $(STDLIB_HEADERS) "$(CONFIGURATION_BUILD_DIR)/../../three20"
So, I still have 7 errors, but I can create the archive...
Upvotes: 0
Reputation: 11148
Configuration that works both for build and archive in Xcode4.
https://github.com/pazustep/three20/commit/4a9aad4eb90a6962dd729d245f9293a7cc0d7f36
REPO_ROOT_PATH = $(SRCROOT)/../..
ROOT_SOURCE_PATH = $(REPO_ROOT_PATH)/src
//OBJROOT = $(REPO_ROOT_PATH)/Build
//SYMROOT = $(OBJROOT)/Products
// Search Paths
LIBRARY_SEARCH_PATHS = $(STDLIB_LIBRARY)
//HEADER_SEARCH_PATHS = $(STDLIB_HEADERS) "$(CONFIGURATION_BUILD_DIR)/../three20"
HEADER_SEARCH_PATHS = $(STDLIB_HEADERS) "$(BUILT_PRODUCTS_DIR)/../three20" "$(BUILT_PRODUCTS_DIR)/../../three20"
# Ignore whitespace characters in paths
IFS=$'\n'
#cd ${CONFIGURATION_BUILD_DIR}${PUBLIC_HEADERS_FOLDER_PATH}
if [ "${DEPLOYMENT_LOCATION}" == "YES" ]; then
PREFIX=${BUILT_PRODUCTS_DIR}/..
else
PREFIX=${BUILT_PRODUCTS_DIR}
fi
cd ${PREFIX}${PUBLIC_HEADERS_FOLDER_PATH}
chmod a-w *.h 2>> /dev/null
chmod a-w private/*.h 2>> /dev/null
exit 0
Upvotes: 13
Reputation: 11148
three20.info: Xcode 4 Transition Guide
http://three20.info/article/2011-03-10-Xcode4-Support
This guide has been put together by the Three20 team in order to help you migrate your apps to Xcode 4 successfully.
Upvotes: 2
Reputation: 2141
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.
Upvotes: 4