26

I have a valid Apple iOS dev account and all provision profiles set. I can debug the application on my iPhone. But when I do Product -> Archive and went to the organizer, there is only a "Validate..." and "Distribute..." button.

Clicking the "Distribute..." button only provides me with "Save built products" and "Save Xcode archive" which both doesn't contains any "IPA" file.

There is however an "MyApp.app" file built. I'm not sure what to do about it though.

Suggestions?

Cœur
  • 37,241
  • 25
  • 195
  • 267
chakrit
  • 61,017
  • 25
  • 133
  • 162
  • You don't see a "Save for Enterprise or Ad-Hoc Deployment? Are you using an adhoc profile? – Nic Hubbard Feb 23 '12 at 05:38
  • @NicHubbard Yeah, no save for enterprise thing. How do I know if I'm using an adhoc profile? I *think* I'm using the right distribution profile but I'll check again. – chakrit Feb 23 '12 at 05:40
  • Edit your Scheme and see what you have for Archive. What build configuration is it using? I always create a Ad Hoc build config. so I set Archive to that. – Nic Hubbard Feb 23 '12 at 05:44
  • @NicHubbard I have had it set to Adhoc build before (which was duplicated from a "Release" build. It's now set to the "Release" config though. – chakrit Feb 23 '12 at 05:48
  • I would change it to adhoc, then archive again and see if you have a new option. – Nic Hubbard Feb 23 '12 at 05:48
  • @NicHubbard you mean literally "adhoc" ? trying.... – chakrit Feb 23 '12 at 05:54
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/8098/discussion-between-chakrit-and-nic-hubbard) – chakrit Feb 23 '12 at 05:56
  • @Chakrit try to create to IPA file using Adhoc Profile. Then It'll work as according you – Kamar Shad Feb 23 '12 at 06:20

2 Answers2

40

In short: Make sure you have configured all linked libraries with "Skip Install" to "YES" in the build settings screen. There are a few detailed instruction on how to do that here on SO.

Failing that, clicking on "Validate..." should clue you in to any potential fixes.


So, I just set-up my machine and somehow on one of a library project "Skip Install" was reverted to "NO".

The first sign that this is wrong is that the "Archive Type" shows up as "Generic Xcode Archive" which is the wrong one.

You can verify this by selecting the archive in organizer and clicking "Validate...", Xcode should tells you about the multi-bundle problem.

The "contains multiple product" is a known Xcode issue and can be worked around by making sure that all built products in all of your projects have the build setting "Skip Install" set to "YES" except for your main application project. This can happens if you add a library project by dragging the xcodeproj file into Xcode.

After fixing it and re-archiving, it should now shows up with an archive type of "iOS App Archive".

And if you click "Distribute..." now, you will now be able to properly export an IPA by selecting the second option.

Cœur
  • 37,241
  • 25
  • 195
  • 267
chakrit
  • 61,017
  • 25
  • 133
  • 162
  • 8
    I changed the "Skip Install" to Yes on my projects, but was still getting an issue. I had to check the "Copy Headers" build phase of my static library as well. See: http://stackoverflow.com/a/5318616/596115 – Ian L Mar 08 '12 at 15:13
  • 3
    The reason that my project couldn't be validated was that one sub-project (another target in the project) had a public *.h file. This was copied to the output and thus the app couldn't be signed. The easy way to find what's there is to ctrl-click on the built archive in the organizer and go to the finder - anything in the usr/ directory needs to go. – Sean Doyle Mar 23 '12 at 14:56
  • 2
    I had this problem with a different cause: I had a target in my project (not the main target) that I created as a console tool, and Xcode had automatically created a man file for it and a copy-files build phase to install the man file in a public location (/usr/share/man). Once I removed this build phase, the error disappeared. – Colin May 02 '12 at 16:58
  • great! it helped me!! I had this problem also, BUT in my case I looked at the "simple" build settings, rather than "all" build settings. And inside the "all" this "skip install = no" was hidden (malicious!) – nurnachman Aug 06 '12 at 15:38
  • @chakrit the links are broken – Matt Jul 16 '18 at 21:07
9
  1. Your PROJECT - Skip Install - set to NO
  2. Your libraries - Skip Install - set to YES
  3. In your SUBproject you should check "Copy headers" section

click on SUB project

Sub project

Building Phases

enter image description here

DRAG all files fron Public and Private sections to PROJECT section

enter image description here

Tim Kozak
  • 4,026
  • 39
  • 44