Xcode 4 & three20 & create IPA archive: No such fi

2020-02-08 16:14发布

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?

12条回答
小情绪 Triste *
2楼-- · 2020-02-08 16:23

Configuration that works both for build and archive in Xcode4.
https://github.com/pazustep/three20/commit/4a9aad4eb90a6962dd729d245f9293a7cc0d7f36


src/common/Configurations/Paths.xcconfig

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"

src/scripts/Protect.command

# 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
查看更多
够拽才男人
3楼-- · 2020-02-08 16:28

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.

查看更多
神经病院院长
4楼-- · 2020-02-08 16:29

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
查看更多
Lonely孤独者°
5楼-- · 2020-02-08 16:30

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...

查看更多
做自己的国王
6楼-- · 2020-02-08 16:33

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.

查看更多
疯言疯语
7楼-- · 2020-02-08 16:36

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.

查看更多
登录 后发表回答