Xcode iOS organizer submit to app store yields "The archive is invalid" error
Asked Answered
C

21

17

I just switched from Xcode 3 to 4. When I attempt to upload an app that I have archived to the organizer, I receive this error:

The archive is invalid. /var/folders/.../app.ipa does not exist.

archive is invalid. app.ipa does not exist.

This happens after I log in to itunes connect, select the application to update and select next. I am not sure where to begin trying to figure out what is causing this error. Please let me know if I am leaving out anything that would be useful for diagnosing. Thanks

Chalmer answered 30/3, 2011 at 8:16 Comment(5)
Any update to this? This is an annoying error!Amory
nope :( I'm gonna have to try recreating a new project and importing it all back in.Chalmer
I did that previously and failed for me, so good luck, update if you succeed!Amory
oh my god. I spent hours rebuilding the project only to receive the message again...Chalmer
A simple workaround - When submitting to the AppStore - select the option "Do not resign" (the second dropdown when you select which app to submit).Quorum
C
5

Okay, so when you install the Xcode 4 package, make sure you have the "Unix Tools" option selected. This was the problem in my case.

Chalmer answered 31/3, 2011 at 20:50 Comment(2)
I had this issue with Xcode 4 and reinstalling it with all tools installed fixed it. Thanks for the tip!Rapeseed
that is unlikely to have anything to do, this error happens randomly without changing anything to your installation you can get it for all validations in a day then it is gone the nextTautonym
N
6

I just faced this problem myself, and I seem to have found a solution to it. Even though the correct provisioning profile seems to be selected, it might not be.

Try to manually navigate the list of possible provisioning profiles and select the correct one. Do not leave the setting on automatic selection.

In the "Identity:"-list, make sure it does not say "Currently matches...". Manually select the correct one yourself.

That should fix the problem and you should be able to upload to the AppStore.

Noctule answered 31/3, 2011 at 10:21 Comment(0)
C
5

Okay, so when you install the Xcode 4 package, make sure you have the "Unix Tools" option selected. This was the problem in my case.

Chalmer answered 31/3, 2011 at 20:50 Comment(2)
I had this issue with Xcode 4 and reinstalling it with all tools installed fixed it. Thanks for the tip!Rapeseed
that is unlikely to have anything to do, this error happens randomly without changing anything to your installation you can get it for all validations in a day then it is gone the nextTautonym
M
4

If you are running an Xcode beta version (Apple calls it a "developer preview") you will get this error because you're not allowed to submit apps from a beta version. This restriction is not mentioned in the Read Me file or on the Xcode download page. To submit an app, you will need to uninstall Developer Tools, then reinstall the latest non-beta version, then restart your computer.

Here's the command-line command to uninstall:

sudo /Developer/Library/uninstall-devtools --mode=all
Mountaineering answered 28/6, 2011 at 16:37 Comment(0)
E
2
  1. Quit Xcode
  2. With a text editor open the file YourProject.xcodeproj/project.pbxproj
  3. Delete all lines containing PROVISIONING_FILE =
  4. Delete all lines containing CODE_SIGN_IDENTITY =
  5. Save & close project.pbxproj
  6. Reopen your project in Xcode
  7. Clean the project
  8. In the Build Settings pane choose the correct code signing identity
  9. Rebuild
Excurvature answered 1/4, 2011 at 21:47 Comment(1)
I had the same problem as the OP. I followed this and after doing it, tried building but failed because now xCode realized I had the same certificate twice in keychain (one was expired). After deleting the expired certificate, cleaning and rebuilding, it worked.Thaumaturgy
A
1

I recently switched to a new MacBook Pro and had XCode 4 installed from a Time Machine drive via the Migration Assistant.

Re-installing XCode 4 with the Unix Tools fixed it.

For some reason those files weren't getting copied across with Migration Assistant.

Antidepressant answered 10/4, 2011 at 9:43 Comment(0)
S
1

I had the same issue for both TestFlight and App Store. The solution for me was to archive the app, and in the organizer select "Don't sign" when you try to validate/submit or share (in the case of TestFlight).

Hope this helps.

Steric answered 27/4, 2011 at 17:58 Comment(1)
This comment made sense to me after uninstalling Xcode and checking all my certs et al. So this time, instead of code signing when validating, I tried this tip, since I told it in the build to sign the archive, and voila!Blackmail
B
1

In my case this has nothing to do with Xcode or the unix tools. Indeed I happend to had too many distribution certificates (Why? I don't know). Deleted all of them but one, code sign with this one, re code sign it while validating and submit it with no errors. I hop this help.

Bone answered 4/6, 2011 at 21:49 Comment(0)
T
1

A good way to test is to run the build from the command line. Change to your project folder and run 'xcodebuild' and look carefully at the outputs, especially around the 'codesign' command.

I did this and discovered the following:

architecture armv7 object: /Users/chris/Documents/x/x/build/Release-iphoneos/x.app/x malformed object
object file format invalid or unsuitable

So it isn't a solution, but it at least lets you zero in on what the problem is. Anyway, for me, looks like an architecture config error.

Update - to fix this problem, i replaced the copy of codesign_allocate in my /usr/bin folder with the one in /Developer/somewhere and that fixed it.

Thin answered 13/6, 2011 at 4:46 Comment(0)
S
1

I tried most of the ideas above, and they did not work for me, likely because I am using he Appcelerator Titanium platform. I did however delete the Build directory and re-built the product and it passed the validation and I was able to upload the binary to the app store.

Secretory answered 28/6, 2011 at 17:47 Comment(0)
T
1

The same happened to me. My mistake was I had certificates with similar names (like "Provisioning Profile of Giammy", "Profile for Provisioning of Giammy"...).

Running "Archive" from XCode 4.0 and then "Validate..." from the Organizer I faced the "app.ipa does not exist" issue. The problem was that I selected the wrong certificate from those with similar names. The "Archive" phase worked good but the archive did not pass the validation.

Solution: just picked up the correct provisioning profile in the "Archive" phase.

Lesson learned: check twice the provisioning profile name!

Tedesco answered 31/8, 2011 at 14:34 Comment(0)
U
0

Make sure that you are signing with keys for correct product/bundle ID. If I remember correctly, mixing that up could lead in archiving problems. Also, go to that temp folder and check what IS created. Maybe xCode is creating the IPA under a different name, that could give you a hint.

Unman answered 30/3, 2011 at 9:24 Comment(1)
I have checked the temp folder that is created and there is nothing in there. Also, I have the correct bundle assigned as far as I can tell. I'm stumped.Chalmer
S
0

I solved this same problem by deleting all of the expired signing certificates from my Keychain. Xcode seems to just grab the first one it finds with the given name, regardless of whether it's still valid.

Spathic answered 16/4, 2011 at 4:56 Comment(0)
A
0

I tried everything including reinstalling xcode4 with unix tools. NOthing works. I assume I shouldnt have to do this as I'm able to submit other apps without issues. I'm just having this issue with a partiular project (coming from xcode3).

I even created a project from scratch, imported all the code over and tried again - failed. so it's not only my project but something in it. So I've started the process of creating a new project, adding some files, then submitting, then rejecting to figure out what's causing it. This is working so far.

update: ok - it has something to do with using CorePlot and linking it in as a library. and voila - found the answer here. Can't submit app with CorePlot using Xcode4 Solution: when submitting select "Don't resign"

Actuary answered 20/5, 2011 at 14:44 Comment(0)
R
0

I was not able to solve this problem by changing or fixing code signing identities (which should resolve this problem in many cases. Nor did simply reinstalling Xcode. These are the top two solutions as I post this answer.

I found success in uninstalling all the developer tools, and reinstalling from scratch.

Rooster answered 12/6, 2011 at 21:50 Comment(1)
Instructions for uninstalling are included in the About Xcode.pdf file in the Xcode installer dmg.Mountaineering
R
0

Here is how I solved it:

  1. Open Keychain and delete all distribution certificates, both from my "login" and from "system".
  2. Download the latest Distribution certificate from the Dev Center.
  3. Double click the certificate to install on Keychain.
  4. On XCode, make sure the certificate name matches on Build Settings.
  5. Build for Archive (a Keychain popup should ask for permission to sign the app).
  6. Archive (again, Keychain confirmation required).
  7. Validate archived app (again, Keychain confirmation will be required).
  8. Submit app (one more time, Keychain confirmation will be required).

If you are building for Archive and you don't see any Keychain confirmation dialog, you can stop at that point because submission is not going to work.

Ranch answered 13/6, 2011 at 6:56 Comment(0)
S
0

i did have this very same issue using xcode_4.2_and_ios_sdk_5_beta__snow_leopard, my working solution.

Install the previous (non-beta) version of Xcode in a different location and work with that version, and that's it, it worked i was able to upload my app to the AppStore without any inconvenience.

regards,

Jorge.

Suffruticose answered 7/7, 2011 at 19:20 Comment(0)
T
0

My solution was:

Open the info.plist file in your project and in product name write your products name instead of $[PRODUCT_NAME]

Tag answered 8/7, 2011 at 9:43 Comment(1)
I tried again without doing the workaround i said about above. Created the archive from XCode and it worked fine.Tag
C
0

Never try to submit using apps you built using beta SDKs as your base SDK.

I got rid of this problem by uninstalling all developer tools with the below command

sudo /Developer/Library/uninstall-devtools --mode=all

and then restarted my system and installed that latest non-beta version of XCode and non-beta iOS SDK.

Caputto answered 31/7, 2011 at 11:44 Comment(0)
F
0

Have you been playing around with the ENTITLEMENTS_REQUIRED attribute at /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/SDKSettings.plist (let say to create jailbroken applications)?

In this case, please reset ENTITLEMENTS_REQUIRED to YES.

Feathered answered 30/9, 2011 at 16:25 Comment(0)
T
0

for xcode 4 I tried every thing but I can t solve this error until install xcode 4.2 for snowleopart

if you cant see your app icon in validation page its can be your xcode have error. download from apple developer page xcode 4.2 and install. its solved. you dont need to uninstall your xcode 4 just download new xcode 4.2 and install. I am very fine now

Tun answered 12/1, 2012 at 10:1 Comment(0)
B
0

Had this error in Xcode, but had no such error when using the Application Loader. Get to it via Xcode -> Open Developer Tool -> Application Loader. Very frustrating indeed.

Bricebriceno answered 2/7, 2016 at 19:12 Comment(2)
Application loader did not exist when this question was asked. Everything is much easier nowadays.Chalmer
Ah didn't realize that. Either way, glad it's still an option, since Xcode apparently still has a bug. But only with certain projects, which makes it even more fun :)Bricebriceno

© 2022 - 2024 — McMap. All rights reserved.