简体   繁体   English

iOS 应用提交:签名无效

[英]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:这是我第一次尝试向 App Store 提交应用程序,但每次尝试后我都会收到此 email:

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).验证 Xcode 中的代码签名设置在目标级别是否正确(覆盖项目级别的任何值)。 Additionally, make sure the bundle you are uploading was built using a Release target in Xcode, not a Simulator target.此外,请确保您上传的包是使用 Xcode 中的发布目标构建的,而不是模拟器目标。 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.如果您确定您的代码签名设置正确,请在 Xcode 中选择“全部清除”,删除 Finder 中的“build”目录,然后重建您的发布目标。

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.我的配置文件中的捆绑包 ID 在我的 iTunes 连接应用程序中是相同的,在 Xcode 常规设置中也是相同的。
  • The same version (0.8.2) in iTunes connect app and Xcode. iTunes 连接应用程序和 Xcode 中的相同版本 (0.8.2)。
  • I'm building with device selected not a simulator (but i don't have a device connected to the mac).我正在使用选择的设备而不是模拟器进行构建(但我没有连接到 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.我有“iPhone Distribution:...”用于所有内容,而且我正在选择分发配置文件。

What I am missing?我缺少什么? I've looked all over and all I find is people with incorrect versions or incorrect bundle id.我四处寻找,发现的都是版本不正确或包 ID 不正确的人。

I am using Cordova and Ionic to build my app, I don't know if that has something to do with it.我正在使用 Cordova 和 Ionic 来构建我的应用程序,我不知道这是否与它有关。

I've seen the troubleshoot guide of Apple on this issue and ran this command:我看过 Apple 关于这个问题的故障排除指南并运行了这个命令:

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 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]存在)'/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我得到: a sealed resource is missing or invalid file modified: /path/to/MyApp.app/MyApp他们建议运行它来解决问题: 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.我希望 Xcode 可以在进入任何提交和测试过程之前先验证名称。

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.我认为您没有使用正确的分发配置文件。在 iTunes Connect 中为应用商店提交创建一个新的分发配置文件,而不是临时配置文件。 see the below image.见下图。

在此处输入图片说明

1)Then, check your bundle identifier that should exactly match with the newly created appstore certificate. 1) 然后,检查您的包标识符应该与新创建的应用商店证书完全匹配。

2)Just Delete your certificates in Provisioning Portal and update the new certificate in Xcode. 2) 只需在 Provisioning Portal 中删除您的证书并在 Xcode 中更新新证书。

3)Goto Organizer / Provisioning Profiles / Refresh and allow Xcode to fetch the latest ones. 3)转到 Organizer / Provisioning Profiles / Refresh 并允许 Xcode 获取最新的。

4)then go to project target->build settings->build options->validate product and change your release mode to yes. 4)然后转到项目目标-> 构建设置-> 构建选项-> 验证产品并将您的发布模式更改为是。 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.我遇到了同样的问题,因为应用程序存档包含非 ASCII 字符的文件。 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:您可以通过在终端中从存档文件夹路径执行以下命令来查找所有包含非 ASCII 字符的文件:

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

Build Settings-> Build Options: Enable Bitcode = Yes helped for me. Build Settings-> Build Options: Enable Bitcode = Yes对我Enable Bitcode = Yes帮助。 I could see the error still, but waiting a little Xcode passed it, and continued to upload the application.我仍然可以看到错误,但稍等一会 Xcode 通过它,并继续上传应用程序。

在此处输入图片说明

Make sure your bundle id should match with App ID and Change project edit scheme to release .确保您的 bundle id 应与 App ID 匹配并将项目编辑方案更改为 release 。

If not try this link http://stackoverflow.com/questions/5196309/ios-code-signing-fails-a-sealed-resource-is-missing-or-invalid如果不试试这个链接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.几天前我遇到了同样的问题,最后我不得不从 Keychain Access 中清除我的分发证书,从开发人员门户中删除并重新生成它们。 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.重新安装证书后,我能够在物理设备上构建和运行应用程序,然后将其存档并发送到 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 .我不得不经历同样的挫折,才能了解到了解 Provisioning 如何工作的最佳资源是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此外,StackOverflow 上处理相同或类似问题的线程很少,例如: 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.我对 xCode 13+ 有同样的问题,在我的情况下,我只是用非特殊字符替换目标名称。

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.该修复解决了我 99% 的问题,因为我的项目中有多个目标,并且一些目标出现了这个问题,因为目标名称中包含特殊字符。

I did run into the same problem as this today, turned out to be a .DS_Store file in the Resource directory.我今天确实遇到了与此相同的问题,结果是Resource目录中的.DS_Store文件。 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. 当我升级到XCode 10时,我遇到了这个问题。一种解决方法是降级到XCode 9,然后将我的应用程序提交到App Store。

  1. Applications > XCode > Move to Trash 应用程序> XCode>移至废纸篓
  2. Download XCode 9 from https://developer.apple.com/downloads/ https://developer.apple.com/downloads/下载XCode 9

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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