xcode iOS 应用提交:签名无效

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/25604674/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 05:28:06  来源:igfitidea点击:

iOS app submission : invalid signature

iosiphonexcodecordova

提问by zerzer

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 提交应用程序,但每次尝试后我都会收到这封电子邮件:

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.

无效签名 - 确保您使用分发证书而不是临时证书或开发证书签署了您的应用程序。验证 Xcode 中的代码签名设置在目标级别(覆盖项目级别的任何值)是否正确。此外,请确保您上传的包是使用 Xcode 中的 Release 目标构建的,而不是 Simulator 目标。如果您确定您的代码签名设置正确,请在 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 .
  • 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 .
  • 我在登录钥匙串中有我的分发证书,带有私钥和公钥。
  • 我的分发配置文件与我之前创建的证书相同。
  • 我的配置文件中的包 ID 在我的 iTunes 连接应用程序和 Xcode 常规设置中相同。
  • iTunes 连接应用程序和 Xcode 中的相同版本 (0.8.2)。
  • 我正在使用选择的设备而不是模拟器进行构建(但我没有连接到 mac 的设备)。
  • 构建设置下的代码签名部分(针对目标和项目)。
  • 我有“iPhone 分发:...”的所有内容,而且我正在选择分发配置文件。

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] 存在并且(证书叶[field.1.2.840.113635.100.6.1.2]存在或证书叶[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/MyAppthey 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 可以在进入任何提交和测试过程之前先验证名称。

回答by gunas

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.

我认为您没有使用正确的分发配置文件。在 iTunes Connect 中为应用商店提交创建一个新的分发配置文件,而不是临时配置文件。见下图。

enter image description here

在此处输入图片说明

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. see the image below.

4)然后转到项目目标-> 构建设置-> 构建选项-> 验证产品并将您的发布模式更改为是。见下图。

enter image description here

在此处输入图片说明

then,clean your project and generate the archive.

然后,清理您的项目并生成存档。

回答by Jleuleu

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

我遇到了同样的问题,因为应用程序存档包含非 ASCII 字符的文件。我重命名了所有这些,然后它起作用了。

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 '*[! -~]*'

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

回答by πter

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

构建设置-> 构建选项:Enable Bitcode = Yes对我有帮助。我仍然可以看到错误,但稍等片刻 Xcode 通过了它,并继续上传应用程序。

enter image description here

在此处输入图片说明

回答by Logger

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

回答by carlodurso

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.

几天前我遇到了同样的问题,最后我不得不从 Keychain Access 中清除我的分发证书,从开发人员门户中删除并重新生成它们。重新安装证书后,我能够在物理设备上构建和运行应用程序,然后将其存档并发送到 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.

您在此处列出的所有步骤都很好。如果您可以连接到物理设备并确保您的证书列在代码签名设置的括号中。

build 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!

祝你好运!

回答by Johan Nordstr?m

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.

我今天确实遇到了与此相同的问题,结果是Resource目录中的.DS_Store文件。在构建之前删除了该文件,然后一切正常。