When upgrading an app - the "invalid binary" error... any suggestions?

While upgrading an existing app, I'm getting the notorious:


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


error.

I've gone through everything step-by-step and did all sorts of forum searches, but I can't seem to find a solution to this.

Some particulars:

1. I do have the distribution certificate in my keychain, and it appears to be associated with my certificate as the agent. The provisioning profile is also visible in the Xcode organizer, with no "yellow warnings" about there not being an identity associated with it or anything like that.

2. When building (and doing all the cleaning of targets etc.) the Code Signing for the target is set to iPhone Distribution: mycompany name, which is properly selectable from the popup menu.

3. The build succeeds and I check the build results and CodeSigning is in there, as well as the embedded provisioning profile and the app name is correct.

4. Examining the created package contents, Code Signing is in there as well, and also the embedded provisioning profile.

5. The app ID I used for the distribution provisioning profile is the same app ID I used for the original app. However I did create a new distribution provisioning profile because certs had expired and I changed the name of the distribution provisioning profile. But the distribution cert is now up-to-date and the app ID is the same as it always was.

6. It's not anything like an invalid Icon.png or anything like that, because that didn't change from the original version. This is just an update.

7. The developer provisioning profile works fine and I can load and run the app on my iPhone.

If anybody has any ideas I would be grateful. I've been in code signing h*ll for two days now.

Thanks,

doug

MBP C2D 17", Mac OS X (10.5), 3.0 GB RAM

Posted on Mar 13, 2009 8:30 PM

Reply
18 replies

Jul 24, 2009 6:57 AM in response to Doug Lerner2

I did not spend 4 days fighting this one (thankfully), but it was 2 hours I could have been doing something more productive. It turns out that simply renaming your app to remove all spaces and special characters is not enough, you actually have to go into your project settings and change the product name so that there are no spaces there either. So if you product name is:

Monster Shooter

Then you should rename it so it reads:

MonsterShooter

Then you can delete the BUILD folder, recompile and the end result is MonsterShooter.app which you can zip up and upload. Previous to this I was building the app as Monster Shooter.app and then renaming the file to remove the space (which was not sufficient). Go to the source and remove the space there, and as an extra guard against it I would start any new project with a title that has no spaces just to make things easier for yourself in the long-term.

Jan 3, 2010 12:58 PM in response to Doug Lerner2

I experienced this error with my second application. I could see that the packaging step was running, but using the wrong provisioning profile every time, no matter what settings I made.

In the end I finally discovered this in the SDK release notes:

Cache Files Moved; New Empty Caches Menu Item

"Xcode caches both Xcode data and project data for performance optimization. In Xcode 3.1 these caches have moved to a new location in /var/folders to provide enhanced security. If you will be using Xcode 3.1 exclusively, you should reclaim the cache space used by previous versions of Xcode by deleting the previous caches at /Library/Caches/com.apple.Xcode (they will be recreated if you open Xcode 3.0 or earlier).

Because Xcode caches can grow to be quite large, there is a new Empty Caches menu item in the Xcode menu that deletes all cached Precompiled Header files, the Xcode plug-in cache, and all other cached data. This may only take full effect after quitting Xcode. You can use this if you have built a large number of projects that you will not build again and need to free up the space taken by cached precompiled headers."

So I used the Xcode "clear cache" feature.

My first build after that failed in the same way, however when I went into the project settings I saw that my provisioning profile settings (correct before I cleared the cache, I can assure you from 800 attempts) were gone.

So I set them onnnne more time, built my project and... success!

The moral of the story seems to be that you should clear the Xcode cache if Xcode behaves irrationally, especially if you have upgraded Xcode and/or MacOS.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

When upgrading an app - the "invalid binary" error... any suggestions?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.