Application failed codesign verification - xcode

I know that there are many articles all over the Internet about this, but no matter how hard I try, I can't find an answer to this question:
I want to submit my finished app to the iOS App Store. I just archived my iOS application in Xcode 4, and I clicked the "Validate..." button in the Organiser. When the app is validated, Xcode tells me this:
Application failed codesign verification. The signature was invalid, or it was
not signed with an Apple submission certificate.
I have a distribution profile that I used to codesign in the target app.
I am not using Application Loader because it is telling me that
Application Loader is currently unavailable... an error occurred talking to the
iTunes store
But the question is, what is wrong with my app, and how can I fix it.
Thanks in advance.

check 2 things in the build log (detail view), search for "embedded.mobileprovision" to see if it's embedded, and check under "CodeSign" if the certificate is the one that you are using for distribution.

Related

iTunes Connect and Xcode 8: your app has changed to invalid binary

Last week, with Xcode 7, I was able to upload without any issue. But today I am getting the message your app has changed to invalid binary.
I have seen that now with Xcode 8 a new icon 20x20 2x and 3x is added. I added one, but still getting the error.
Does anyone had similar problem?
Сheck your email!
In my case, I wasted a lot of time because I did not check my email. When you get such an error, Apple sends you an email with it's description.
For example, this is what Apple sent me:
"This app attempts to access privacy-sensitive data without a usage
description. The app's Info.plist must contain an
NSCameraUsageDescription key with a string value explaining to the
user how the app uses this data."
After days of wrestling with the same problem I finally got my app successfully submitted, but only after being on the phone with Apple Developer support.
A couple of things to keep in mind:
Make sure you set the Info.plist description keys for any entitlements. This is necessary for iOS apps. Mine was a macOS app, so this didn't apply.
Head over to iTunes Connect, and recreate all your provisioning profiles and code signing certificates if you're not 100% sure that they're valid. You can do it for both Developer and Distribution.
In Xcode, turn off automatic code signing for your app, and any build targets (you can try automatic code signing in Xcode after completing steps #2 and #4 but that wasn't what worked for me).
Go to Xcode preferences, and click your development team, and in the sheet that comes up, you should see some "Download" buttons beside the newly created (in iTunes Connect) code signing certificates and provisioning profiles. Click them all. And so you don't get confused in step #5, delete all the other stale provisioning profiles and code signing identities for this app.
In Build Settings for each of your targets, make sure that the Release build setting for code signing, and provision profile are set to the above newly created code signing certificate and provisioning profile.
Bump your build number.
Deep clean your project (Option-Shift-Command-K).
Archive build your app.
In the Organizer that opens up, select the newly archived app, and validate (it always validated, but I still would get Invalid Binary later).
Export the build and select the option "Save for Mac App Store Deployment" or similar.
When prompted, use the same Provisioning Profiles you used previously and save.
Open the .pkg in Application Loader which you can launch from Xcode > Open Developer Tool > Application Loader menu.
I was't getting any emails on the Invalid Binary issue. Instead, I was lucky enough to have set up my iPad with iTunes Connect, and so, like clock-work, I was getting notifications within a couple minutes of uploading the app: "Your app ... has changed to Invalid Binary."
If you don't get one of these Invalid Binary notifications, that's a good sign. Another 10-15 minutes later, I checked the iTunes Connect portal, and I could finally add the uploaded build and submit for review.
After a while of searching, as a last-ditch effort I added every possible 'NS...UsageDescription into each of my target's Info.plist and this seems to have worked. After process of elimination, I deduced that it was either the NSAppleMusicUsageDescription or the NSFaceIDUsageDescription key-string pair that was preventing the upload from being successful so I just added them even though I don't use either in my project. I have also read on some other threads that something with a new version of Xcode required them to have the NSAppleMusicUsageDescription even though they didn't use anything related to Apple Music.

I think I just messed up everything in developer portal and

Just as when I was "validating" my app in Xcode organizer, I have got these two messages:
"The Bundle ID Txxxxxxxxxx.com.xxxxxxxx.xxxx defined in your Xcode Project does not match the Bundle ID that you entered for this app in iTunes Connect xxxxxxxxxxx.xxxxx."
and
"Application failed code sign verification. The signature was invalid, contains disallowed entitlements, or it was not signed with an iPhone Distribution Certificate."
Basically, I just wanted to submit an app that has been rejected by Apple again, but I mess up things by changing developer distribution, provisioning profiles, in fact, I don't even know when I did with the whole uploading process. I am very new to developing, please some experts suggest me what to do will be the best. I will be checking back frequently. Thanks.

Unable to upload app to iTunes

I created an iOS app using appMobiXDK. Now to submit app on iTunes Connect I followed all the steps given in "Build for app store" link. I created all the required certificates also got the build. But when I'm trying to submit the build to "Application Loader", I am getting the following error:
Application failed codesign verification. The signature was invalid, or it was not signed with an Apple Submission Certificate
Any kind of help would be highly appreciated.
We need to create Appstore certificate to submit app to the app store it is present in the distribution tab of developer.apple.com so we need to create it to submit to Appstore.

Self-signed certificate for code signing not showing up in Xcode 4

I'm developing a small app on Xcode 4.2 in Lion to learn the basics of Mac development.
I've got a directory picker controller class as an NSOpenSavePanelDelegate, implementing the - panel:validateURL:error: method, where I'm attempting to make sure that the directory that the user chooses contains files of a certain type that the app supports.
I stumbled across this question here on SO, discovering that the delegate methods don't have access to the file system in sandboxed applications. This would be a problem for the aforementioned case.
Eager to learn more about this, I decided to try sandboxing the app to see what happens. I enabled entitlements and sandboxing for the build target in Xcode and then created a self-signed certificate for code signing in Keychain Access, following this tutorial. The certificate lives inside my login keychain.
The problem is, the freshly created certificate doesn't appear under the Build Settings -> Code Signing -> Code Signing Identity dropdown. The only thing that is there is "3rd Party Mac Developer Application", but the build fails with a code signing issue if that is selected.
Any ideas how I can get it to show up?
I just ran into the same issue. After Quitting and restarting Xcode, my own certificate showed up.

Before signing a mac app and uploading it to the app store

I've been dealing with an issue for a while. The issue is that when I submit my mac app to the app store I'm always getting invalid binary and they are saying it's because of an invalid signature. And that I should make sure it's signed with the installer certificate which it is.
Here is the complete message from them:
Dear Developer,
We have discovered one or more issues with your recent binary
submission for "Mini Week". The following issues will need to be
corrected in order for your application to proceed to review:
Invalid Signature - This error occurs when you have signed your app's
installer incorrectly. There are two certs required for this process:
the "3rd Party Mac Developer Application" cert and the "3rd Party Mac
Developer Installer" cert. When signing your package, you need to
ensure that you are using the Installer cert to sign your package.
Ensure that you are specifying this cert when submitting your app via
the Xcode Organizer or when running productbuild from the command
line.
Once you have corrected these issues, go to the app's version details
page (found in the Manage Your Applications module of iTunes Connect)
and click Ready to Submit Binary. Proceed through the submission
process until the app's status is Waiting for Upload. You can then use
Application Loader to upload the corrected binary.
Regards,
The iTunes Store Team
I've revoked and reinstalled my certificates and development providing profile but that doesn't seem to help so I'm assuming that's not the issue.
Is there something else that could cause this? Maybe I need to make sure something is correct in my build settings or something like that? But if so what? :)
Thank you in advance!
Actually, the signing process does not happen when you submit the app from Code Organizer. Conversely, it may happen when you build your app for deployment, but only if you selected the appropriate cert on the "Code Signing Identity" in the target build settings.
Note that you could also manually sign an existing app via command line:
codesign -s "<name of your signing cert>" -fv "<path/to/your/app/bundle>" -o kill,hard
where <name of your signing cert> is the canonical name of your 3rd Party Mac Developer Installer cert. The optional -o kill,hard enforces the code signature for the OS to allow user to launch the application: if you omit this option, an user could open the app bundle, delete the code sign folder, and copy the app on a different machine. With this option, your app bundle will only launch on the authorized machine, and will not run when the signature folder is not present.

Resources