Sunday, November 23, 2008

iPhone Dev: "The binary you uploaded was invalid. The signature was invalid, or it was not signed with an Apple submission certificate."

I finally finished my iPhone game this week (Zombie Mansion). All I had to do on Saturday was upload the it into the App store and spend the rest of the weekend relaxing at the beach.

Not so fast. I have spent all weekend battling the dreaded "The binary you uploaded was invalid. The signature was invalid, or it was not signed with an Apple submission certificate." error. As is often the case with error messages, the message itself was on no use what so ever in solving the problem. It was in fact a positive hindrance as I spent several hours redoing my distribution certificates, provisioning profiles and waving dead chickens (frozen) over my keyboard.

In the end I resolved it by moving my dev folder off the thumb drive (fat 32 formatted) and onto the main Mac partition (Mac OS ext format) and rebuilding.

For the benefit of any other poor buggers in the same straits, here is a list of tips I picked up while investigating this:

  • Build on a Max OS Est formated drive (you only need to do this for the App store build)
  • Make sure you have a 57*57 icon called (case sensitive) "Icon.png"
  • Check the spelling of the code signing identity
  • make sure your bundle app id is correct
  • Make sure the app bundle contains the following:

One think I found helpful was having an ad-hoc version. That let me sort out problems with certificates much more easily than doing continuous uploads.

iPhone Dev forums discussion:
Zombie Mansion:


Dennis said...

Just a question aside:
Which language did you use - objective-c? As a delphi developer whats the best language in you option for use of an iphone development?

Sean said...

That's a post in itself. I used c++/c for Zombie Mansion. Oolong ( provided a c++ framework that wrapped the objective c sdk into something more useful.

I wrote most of the code in visual studio, only going to OsX and XCode when I needed to do iPhone specific stuff.

If you are writing a game, the your choices are ObjC, C++/C, or C#. C# currently requires Unity and I haven't yet seen anything astonishing coming out of it (still early days though).

If you are writing an application, then you are mostly stuck with ObjC (afaiaa). You can use c++, but you need wrapper functions to access the ObjC sdk.

Anonymous said...

The big and very important secret how to fix the Upload invalid signature problem is:

1. you have to go into your user directory/Library/MobileDevice/ProvisioningProfiles/
2. REMOVE both Hexy named files.
3. Go to backup copy and double click on both Dist and Dev cerificates to load them into XCode again.
4. Everything will be fine after that.

Somehow When you copy Release to Distribution project profile this data got screwed because it is cached.

Adam said...

@Anonymous above:

...actually, when you do that, you may find it breaks things even more.

Anonymous is right - this fixed it for me - but I had to do a couple of extra things.

1. When I re-installed the provisioning profile, it was copied into the profiles folder with a NON HEX name (yes, Apple sucks).

2. ...which causes "file not found" build errors in XCode...

3. So I had to go to the folder and manually copy/paste the provisioning profile, and rename it to the EXACT name that XCode was looking for (a Hexy name)

4. XCode still wouldn't work, complainining about b***sh*t.

5. Clean All ... and then reuild ... and the spurious complaints go away

And it worked!

NB: for the record, I had done the Clean All beforehand and it hadn't made this work until I did the delete-and-reload-profiles trick

brianu said...

THis may seem a silly newbie question, but I've got an app ready to go, but How does one build a "binary bundle?"

I assume my release build is creating it, but I'm not sure where to find it... I tried uploading the entire folder and the message said it didn't contain an .app


Sean said...

Inside your project folder is another folder called Build. There will be another folder inside for each of your build settings. Find the folder for your distribution and look into that. There will be a .app file. right click on it and choose compress, then upload the .zip file it creates.

brianu said...

Sean ! Thanks for your effort to help me out!

A couple of other questions I have:

1. When you build for the app store do you set all the build settings and code signings to Distribution?
I saw it suggest that in the document but seem to suggest that it should be set to "Release"

2. in the Build folder will I be compressing a file that has a .app. DSYM suffix? or a whole folder?

I tried that and iTunesConnect told me it didn't contain a ".app bundle".

So far I see none with just .app there.

thank you!!

Harvey said...

I'm having crazy problems with this very error.

One question about your tips. The embedded.mobileprovision file. Should I be able to see that when I cntl click on my .xcodeproj project file and select "show package contents"? Or is that file somewhere else?

Where should that be?

Thanks for this, this problem is a major headache!

Sean said...

The mobileprovision file is not stored in the .xcodeproj so you wont be able to see it there.