Uploading Binary iPhone App "The signature was invalid" again again and again - iphone

I'm going crazy! I'm trying to upload the binary of my first application but I have always the same error!
"The binary you uploaded was invalid. The signature was invalid, or it was not signed with an Apple submission certificate."
I did everything, EVERYTHING!!
I created the request for the certificate, used it for both developer and distribution certificate, created the provisioning profile (12 times!!!) always cleaning my keychain and my Xcode deleting the old certificates and profiles..
I reboot the machine, reboot Xcode, the log is correct, but... I can't upload my app!!!!
Checked if my iPhone is connected (i tried with iPhone disconneted too).
I checked the certificate in both my project settings "Distribuition" Configuration (duplicate of "Release" configuration) and in my target settings.
Reveal in finder, compress the app and sent the zip...
I tried with Application Loader and iTunes connect online..
but nothing! NOTHING!!
I've spent 8 hours! And again i can't have my app uploaded!!!
I'm really going crazy!
Can anyone help me pleeease?
Thx!

It seems like there are a LOT of causes for receiving this cryptic and mostly unhelpful email. Even after verifying the use of distribution certificates, cleaning & rebuilding my project, and checking with codesign from the command line (and following instructions from the email), no errors showed up—-but I'd get the "invalid signature" email right after uploading. All the solutions seem anecdotal and obviously depend on what secret error is causing the problem. I've spent the last week pulling my hair out, trying to figure it out for my app—-and finally got it successfully submitted today—so let me share my story and see if it's relevant to your situation.
In my case, I seemed to have a complex cause of having my Entitlement.plist set with an incorrect variable along with the holdover of an old provisioning profile (from a previous Xcode version?) buried deep in the project.pbxproj component of my Xcode project file.
The "aps-environment" variable in my Entitlements.plist was set to "distribution" instead of "production" (I swear I read somewhere in the developer docs that it was supposed to be "distribution"!) But fixing that alone wasn't enough to get my app through. (I must have submitted 100 different combinations of app configurations trying different variables!) Starting with the helpful suggestions from this post on another forum, I dug through the distribution profile and found duplicate entries for some variables. The duplicates had empty quotation marks (i.e. nothing set for the variable) or strange variables or old provisioning profiles which seemed to be causing problems (somehow). Cleaning this up and removing the duplicate lines with bad variables worked in my case. YMMV. But carefully examining the project files ("show contents" on the Xcode project file in finder) seems like a good idea for diagnostics. Good luck!

Been there - done that.
Make sure your certificate is in the "login" keychain, and that that i the default keychain (highlighted bold) in Keychain Access
Make sure you have both the private and public keys for your certificates and that they are valid. You will also need the Apple Worldwide Developer Relations Cert Authority installed.
I assume you have dragged the profile into xcode - easiest to drop them onto the xcode icon on the dock.
Make sure as Paul says, that the bundle identifiers all match up
You say you checked the certificate in the distribution configuration. Its not the certificate you need to concentrate on but the provisioning profile.
Select your Release config top left, click on the project under groups & files and do cmd I. Select build tab and then pick distribution in the top left. Then look at the Code Signing Identity. Pull down the dropdown list and make sure you have the right application identifier, the right profile and the right certificate. Don't use the Automatic Profile Selector.
Hope one of those steps helps!

I was getting the same error when I tried to submit a version update from the Organizer. What solved my issue was using the Application Loader found in the directory /Developer/Applications/Utilities. You'll need to compress your .app file and send the corresponding .zip file. I used this for my initial submission as well, I just thought I'd try the new way. What a pain! Go with Application Loader.

Best solution:
Revoke Distribution Certificate
Create new AppStore provisioning profile
This solved my problem. Spent 4hrs+ :( :)

I just had this problem. I resolved it, after hair-pulling, by going back into Keychain Access one more time and discovering the "Show Expired Certificates" menu item. When I did that, one more expired cert of the kind I had (so far, unsuccessfully) replaced showed up! I had deleted a couple of expired certs already, but this menu item caused another to show up, and after deleting it, my upload worked. I was previously aware that expired certs can get in the way of valid ones, and I STILL wasted a lot of time. Hopefully, this helps some people.

Related

Issues generating Push Notification SSL Certificate

I'm trying to generate an Apple Push Notification service SSL Certificate - here's a screen-grab:
(source: 818kimball.com)
(blurred certificate name for privacy purposes)
but after hanging at that screen for 2 minutes, I then keep getting this error:
(source: 818kimball.com)
I'm doing everything right, I checked and re-did all my steps, several times, verified it all using multiple sources (like http://mobiforge.com/developing/story/programming-apple-push-notification-services) - but this error keeps popping up.
Anyone have any idea what's going on or how to solve it?
And in the error, where it says "or try using the Provisioning Portal" - anyone know what specifically they're talking about? I mean I know where the provisioning profile is, I poked around in there - but what specifically am I supposed to click or do there?
Any help would be greatly appreciated.
This have happened to me sometime. I think i got it solved by using another apple id(since my company had another one). But that may not be necessary. Try doing it after sometime, clearing all your browser cache. It should work, if what you are doing is correct

Code Sign error: Provisioning profile can't be found

I have been working the whole day to try to build my app on my device.
I get this error when I try to build on my device.
I have been reading about this problem but do not really understand how to fix it. The following is where I would believe the problem is. I am new on this so I have no experience how to solve this.
When I open the "Dont Code sign" I have "Automatic profile selector (recommended)" with two lines I can select and also "My profile for dev" with one line to select. Do not know if this is where the problem is?
Any help is appreciated.
Here's how I did it.
Shut down Xcode.
Back up the project.pbxproj file.
Edit the project.pbxproj file and remove lines of instances where it mentions the old provisioning profile.
eg. Delete line:
PROVISIONING_PROFILE = "8D024EDA-DC05-40DF-B3EB-536392615EE2";
Restart Xcode and perform a full clean of the project.
It should then build without warnings.
Enjoy!
In my case it was because the xcode 4.0.2 prevented deletion of stale data in the project.pbxpro in the *.xcodepro directory. I ended up hand editing the file after shutting down xcode. In the file I looked for all of the occurrences of "PROVISIONING", something like this:
PRODUCT_NAME = Xyzzy;
PROVISIONING_PROFILE = "CF5F0AEA-92D9-48E1-99DF-301AB36C2BFB";
"PROVISIONING_PROFILE[sdk=*]" = "CF5F0AEA-92D9-48E1-99DF-301AB36C2BFB";
SDKROOT = iphoneos;
and changed it to:
PRODUCT_NAME = Xyzzy;
"PROVISIONING_PROFILE[sdk=*]" = "";
SDKROOT = iphoneos;
I restarted xcode and the build succeeded with out issue. A word of caution make sure that you back up the project directory before make changes to the project files, and only hand edit the files when you have no other options.
I went and changed code signing identity the on project and target to "Don't Code Sign" and then changed back to the correct code signing identity. That fixed it for me.
what exactly is the error message?
Did you add your device including the required provisioning profile in the organizer? What do you see in the organizer when selecting your iPhone under devices? It should be there with the correct valid profile...
If you are working with a project created by someone else as a template, you need to change the code signing identity
screenshot: http://i.stack.imgur.com/UIpGS.png (Xcode 4.2)
ps. OSX would not let me edit the .pbxproj file with a text editor
I had this problem when I had to reissue development provisioning profiles with new names/ids.
The solution was to update all references in Edit Project Settings | Build (Code Sign) referring to Code Sign Developer (name). (Not Edit Active Executable.)
Click on the item(s) and check that the new profile is explicitly selected, and rebuild and run.
I suspect that the reason you get this error in the first place depends on whether or not you have set xCode up to try to resolve these dependencies automatically. In one of my builds replacing the profile was seamless - in the other I had to manually update it. Clearly the best solution would be a seamless one.
I've had this before, and it just worked by restarting Xcode. Probably won't work for you but I'll throw it out there anyway.
I had same error where the very previous build built just fine. I noted that my Build Settings -> Code Signing -> Provisioning Profile had been reset to strange one. All I had do is to point it to correct one to resolve the issue.
This one can be fixed by changing the project settings AND clicking Project > Edit Active Executable > Build and changing the settings there.
I just redid my provisioning profile and re-added devices to the portal in Organizer. Then I clicked my project icon, entered Build Settings, Code Signing and remapped to the new provisioning profile.
I had the provisioning profile set to one thing in Projects and another in Targets. Do a search in your project for the file that is missing and see if it pops up. No hand editing needed!
Like #Jonathan, I just restarted Xcode and it worked after it automatically retrieved the profile from my Apple developer account. This was Xcode 6.2

iOS code signing fails: "A sealed resource is missing or invalid."

I have been with this problem already 8 hours unable to solve it.
Whats Cool JLD$ codesign -vvvv build/Distribution-iphoneos/Whats\ cool\?.app
build/Distribution-iphoneos/Whats cool?.app: a sealed resource is missing or invalid
/Users/JLD/Desktop/iOS Development/Whats Cool/build/Distribution-iphoneos/Whats
cool?.app/Whats cool?: resource modified
I have tried the solutions posted on all these threads to no avail:
https://discussions.apple.com/thread/1590980
https://discussions.apple.com/message/9167082
http://www.iphonedevsdk.com/forum/iphone-sdk-development/2256-application-failed-codesign-verification.html
https://forums.macrumors.com/threads/entitlements-plist.584209/
How to solve "Application failed codesign verification" when uploading to iTunes Connect?
I even tried recreating the whole project again redoing all the IB connections and nothing works! It builds everything, but it is unable to code sign it! So I'm unable to upload it through the AppLoader.
I am doing all these following the instructions found at the provisioning profile on the Distribute application page.
https://developer.apple.com/ios/manage/distribution/index.action
I even tried building from another Mac. I have my distribution profile and my distribution certificate both set to WildCard. But it still doesn't work. I made a new app under a different name with another Bundle ID to no avail. I don't know what to try anymore!
Thank you future problem solver! I know you are there so come to my aid, I'll thank you forever!
UPDATE: I tried to make the new project from scratch. Copying the source code and remaking all the connections on IB to no avail. I even followed this link with instructions:
http://techiechok.com/2009/03/30/resolving-iphone-code-signing-error/
Unsuccessful. I don't know what else to do. I'm even considering using one technical incident to solve this problem once and for all.
I just experienced this error trying to sign an archive with Xcode 4 on Lion. The problem turned out to be related to the fact that the archive had been zipped on one machine and transported to another --- the zip utility did not support symbolic links, and the app code signature uses a symlink inside the bundle, so the unzipped archive was invalid.
Possible solutions are:
Use the Finder's contextual (ctrl-click/right-click) menu and choose "Compress" to create the zip file, or:
Use the command line version of zip and provide it with the -y argument to preserve symbolic links.
This isn't a specific answer I'm afraid, but something you may not have thought about.
From your command line snippet, it looks like you're code signing your app bundle after it's been built. Are you moving the bundle (.app folder or maybe an IPA or ZIP file) from another machine, or from another drive? I've had problems with moving app bundles between file systems that don't support symbolic links properly. Are you using a network drive, or have a local drive that's not formatted for Mac OS.
Solved. The problem was a '?' character on the product name. Shouldn't be like that but that's how it is. Nowhere apple says that that makes a codesign verification issue.
Apple's new APFS file system has some bugs to process unicode characters and it is causing the issue.
Moving the whole project to the legacy MacOS Extended volume and archiving again solved the issue.
Another problem could be your app contains image file name with none English characters in your app. Such as 'ş ç ğ'. If you remove those images or change the file name it will proceed.
I passed days on this problem, for me it's because the name of the application contains arabic caracters :(, So apple on xcode 12 doesn't accept arabic caracters ? on xcode 10 i publish without any problem
it's very complicated to be a developper on ios
In my case, I got that error because the disk image I created to distribute my app ran out of space and ditto did not copy all files from the build folder to the disk image. As the script I used generates so much noise, I missed the warning of ditto that it ran out of space in the target disk image. Unfortunately, ditto should have aborted the whole procedure, instead of burying the warning into a myriad of other paths of smaller files that it managed to copy.

Apple App Store: INSTALL_ERROR_DISTRIBUTION_SIGNED_BY_APPLE

Anyone else getting this error when trying to download an app from the new Apple Mac App Store?
INSTALL_ERROR_DISTRIBUTION_SIGNED_BY_APPLE
I just ran into this problem while trying to update an application, but my problem was not an unsynchronized clock (ntpdate -q time.apple.com showed a maximum offset of 0.022479).
I found a hint in an a thread on one of Apple’s discussion forums that the problem might be related to certificate status checking settings. Modifications in this area resolved the problem for me. In the Keychain Access application, after selecting the Keychain Access menu > Preferences… menu item, and switching to the Certificates tab (close this preferences window when done making any changes), I ended up changing both my OCSP and CRL settings from “Require if Cert Indicates” (which seemed like a useful, “strict” setting to me), to “Best Attempt” (the Priority remained “Require Both”).
It seems that the “Require if Cert Indicates” and “Require for All Certs” options are normally grayed-out (I originally set them back on a machine running Tiger, which was migrated to this Snow Leopard machine). I found that you can hold down Option while clicking on the popup button (a.k.a drop-down list) to enable and select these options though. I may go back and try to determine which setting (OSCP or CRL) was strictly necessary.
I got the same error because my OS time/date was not correct.

Submitting application update to iTunesConnect (madness!)

iTunes connect keeps rejecting my binary for an application update and it's driving me mad. Usually I can figure it out but I've tried everything I can think of. Maybe someone can lend a hand :)
The error I'm getting is:
The binary you uploaded was invalid. The signature was invalid, or it was not signed with an Apple submission certificate.
I am uploading an updated version of my app to the store. The current version is 1.0, this new one is 3.0. Here's what I've tried:
Zipped the app bundle with the
command line (I've heard the Finder
zip utility can be bad sometimes)
Checked my app is signed properly
with $> codesign -vv myApp (says
"Valid on disk)
Checked in the build
log for the correct provisioning junk
to be there
Made sure in my
Info.plist file the CFBundleVersion
and CFShortBundleVersion are
incremented from my current version
That's what I can think of to check so far, and everything looks good as far as I can tell.
Now I've read somewhere in the Portal that says you must sign updates with the same Distribution Cert as before, and I am (I think). However I have to sign with a new provisioning profile because the old one I used for App Store has expired (or something, I don't know it just won't work).
Things to know about my situation
This update is actually a complete re-write from a new template, BUT I've made sure I'm using the exact same App ID (wildcard) and bundle indentifier) so that shouldn't be a problem.
Also, I've switched machines since I last submitted to the App Store but I remembered to export everything (I think) from my old machine. I still have the old one here, with all the same data on it, if that's helpful. I don't think I've forgotten anything).
Thanks in advance for any help :)
Update
So I've decided to try uploading with the Application Loader to see if it will give me any new errors, and it has, it spewed this out into the console. Perhaps someone can find something meaningful there.
Also of note, the Portal Guide says Updates must be signed with the original Distribution Provisioning profile as was used to sign the original app. I've tried using that old one, but Xcode won't let me select it, as there's "No matching key pair" or whatever. Is there a way to remedy this? According to Keychain I've got my Distribution Cert and its private key, it all looks valid. I've made sure to try Repairing the Keychain in case, but no change.
This is always the fun part, isn't it?
Assuming you've double and triple checked the usual stuff (using the right cert, compiling for device, have a proper icon file, app ID, etc.)
One obscure reason I've run into was roughly the same as the one outlined here:
http://discussions.apple.com/message.jspa?messageID=9167082#9167082
To sum up, my project.pbxproj file somehow ended up with two different entries for PROVISIONING_PROFILE (even though the XCode interface only showed one). My file looked a bit different from the one posted in that discussion, but removing the extra entry fixed the problem for me.
It's simple! Just let Finder zip it.