Why does xcode archive succeed but create an empty

2020-07-10 08:23发布

问题:

Background

I have an application I'm trying to archive and submit to the app store for approval. Part of the process requires the archive to be prepared and loaded using application loader. I used product-> archive and it prompts archive succeeded but it does not appear on the Organizer -> Archive tab.

Detail of Project build

1 app target, "AppName"

1 static library, cocos2d libraries (cocos2d v0.99.5-rc1)

Xcode Version 4.0.2

First steps

Setting "Skip Install" to "No":

  1. Project
  2. AppName target
  3. cocos2d libraries

Setting skip install on the three allows me the archive to be built and show up(non-empty xcarchive) on the organizer. However, when I try to validate, it'll prompt:

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

I checked that the archive package contents include the cocos2d libraries within a directory "Products". According to some posts and the cocos2d forum, we're not supposed to submit that as part of the binary for approval.

Steps taken to the Zero KB .xcarchive

Since the static cocos2d libraries library should not to be included, I've changed the cocos2d libraries target to have skip install: "Yes". Now, if I archive the project it prompts build succeeded but it creates an empty .xcarchive file that cannot be seen on the organizer->archives tab.

回答1:

I have the solution to my problem and if anyone else is facing the same problem here are the steps i took to fix the problem.

cocos2d library

-Set the skip install to YES for all configurations in your cocos2d library.

-Set the code signing identity to Don't code sign for all configurations. Static libraries are not code signed.

-Update the installation directory to /usr/local/lib.

app library

-Update the installation build products location to /tmp/$(PROJECT_NAME).dst

-Update the installation directory to $(LOCAL_APPS_DIR) (/Applications).

-Update the code signing identity section.



回答2:

What worked for me was to delete the lines SKIP_INSTALL = YES; from the various *.pbxproj files.

Hat tip to this blog. (No instances of INSTALL_PATH found in our files.)