简体   繁体   中英

iOS app submission : invalid signature

I'm struggling with this issue for more than a week now, I've tried all I could find on Google with no luck. This is my first time trying to submit an app to the App Store, but I keep getting this email after each try:

invalid Signature - Make sure you have signed your application with a distribution certificate, not an ad hoc certificate or a development certificate. Verify that the code signing settings in Xcode are correct at the target level (which override any values at the project level). Additionally, make sure the bundle you are uploading was built using a Release target in Xcode, not a Simulator target. If you are certain your code signing settings are correct, choose "Clean All" in Xcode, delete the "build" directory in the Finder, and rebuild your release target.

so here is what I'm doing:

  • I have my distribution certificate in login keychain, with the private and public key.
  • I have the distribution provisioning profile with the same certificate i've created earlier.
  • The bundle ID on my provisioning profile is the same on my iTunes connect app and the same in Xcode general settings.
  • The same version (0.8.2) in iTunes connect app and Xcode.
  • I'm building with device selected not a simulator (but i don't have a device connected to the mac).
  • the code signing part under build settings (for both target and project).
  • I have "iPhone Distribution: ... " for everything and also i'm selecting the distribution provisioning profile.

What I am missing? I've looked all over and all I find is people with incorrect versions or incorrect bundle id.

I am using Cordova and Ionic to build my app, I don't know if that has something to do with it.

I've seen the troubleshoot guide of Apple on this issue and ran this command:

codesign --verify -vvvv -R='anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.1] exists and (certificate leaf[field.1.2.840.113635.100.6.1.2] exists or certificate leaf[field.1.2.840.113635.100.6.1.4] exists)' /path/to/the.app

I get: a sealed resource is missing or invalid file modified: /path/to/MyApp.app/MyApp they suggest to run this to resolve the issue: dot_clean path/to/xcodeproject

But that didn't help, I keep getting the same error. Please help, I'm out of clues

EDIT ( Solution )

Apple is just a big stupid company, none of the suggested solutions under any of the posts helped me, it was just the stupid process of apple? I had an invalid character "." that should have been removed from the App Name. I wish Xcode coulde validate the name first before going into any of the submitting and testing process.

I think you are not using the proper distribution profile.Create a new distribution profile in itunes connect for app store submission not the ad hoc one. see the below image.

在此处输入图片说明

1)Then, check your bundle identifier that should exactly match with the newly created appstore certificate.

2)Just Delete your certificates in Provisioning Portal and update the new certificate in Xcode.

3)Goto Organizer / Provisioning Profiles / Refresh and allow Xcode to fetch the latest ones.

4)then go to project target->build settings->build options->validate product and change your release mode to yes. see the image below.

在此处输入图片说明

then,clean your project and generate the archive.

I had the same issue because the application archive contained files with non-ASCII characters. I renamed all of them and then it worked.

You can find all files with non-ASCII characters by executing the following command in the terminal from the archive folder path:

LC_ALL=C find . -name '*[! -~]*'

Build Settings-> Build Options: Enable Bitcode = Yes helped for me. I could see the error still, but waiting a little Xcode passed it, and continued to upload the application.

在此处输入图片说明

Make sure your bundle id should match with App ID and Change project edit scheme to release .

If not try this link http://stackoverflow.com/questions/5196309/ios-code-signing-fails-a-sealed-resource-is-missing-or-invalid

I had the same issue a couple of days ago and in the end I had to clean my distribution certificates from Keychain Access, remove and regenerate them from the developer portal. After reinstalling the certificates I was able to build and run the app on the physical device, then archiving it and sending over to the App Store.

All the steps you listed here are fine. If you can connect to a physical device and make sure your certificate is listed between brackets for the code signing settings.

构建设置

I had to go through the same frustration in order to learn that the best resource to learn how Provisioning works is the App Distribution Guide .

Additionally, there are quite few threads on StackOverflow dealing with the same or similar issues like this one: App Submission: Invalid Binary - Invalid Signature

Good luck!

I have a same problem with xCode 13+, in my case i just replace the target name with not special caracter.

That fix solved my problem 99% because i have multiple targets on my project and some targets presented this problem because contained special carcters in the target name.

I did run into the same problem as this today, turned out to be a .DS_Store file in the Resource directory. Removed that file before building and then everything worked out.

I had this issue when I upgraded to XCode 10. One workaround was to downgrade to XCode 9 and then submit my app to the App Store.

  1. Applications > XCode > Move to Trash
  2. Download XCode 9 from https://developer.apple.com/downloads/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM