iTunes Connect 和 Xcode 8:您的应用程序已更改为无效的二进制文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/39458207/
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 09:13:41  来源:igfitidea点击:

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

xcodebinaryapp-store-connect

提问by Dietmar Schwarz Webers

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.

上周,使用 Xcode 7,我可以毫无问题地上传。但是今天我收到了您的应用程序已更改为无效二进制文件的消息。

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.

我已经看到现在使用 Xcode 8 添加了一个新图标 20x20 2x 和 3x。我添加了一个,但仍然出现错误。

Does anyone had similar problem?

有没有人有类似的问题?

回答by Ptah

С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.

就我而言,我浪费了很多时间,因为我没有查看电子邮件。当您收到此类错误时,Apple 会向您发送一封包含其描述的电子邮件。

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."

“这个应用程序试图在没有使用说明的情况下访问隐私敏感数据。应用程序的 Info.plist 必须包含一个 NSCameraUsageDescription 键和一个字符串值,向用户解释应用程序如何使用这些数据。”

回答by Dalmazio

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.

经过几天与同样的问题搏斗后,我终于成功提交了我的应用程序,但前提是通过电话获得 Apple Developer 支持。

A couple of things to keep in mind:

请记住以下几点:

  1. 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.

  2. 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.

  3. 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).

  4. 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.

  5. 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.

  6. Bump your build number.

  7. Deep clean your project (Option-Shift-Command-K).

  8. Archive build your app.

  9. In the Organizer that opens up, select the newly archived app, and validate (it always validated, but I still would get Invalid Binary later).

  10. Export the build and select the option "Save for Mac App Store Deployment" or similar.

  11. When prompted, use the same Provisioning Profiles you used previously and save.

  12. Open the .pkg in Application Loader which you can launch from Xcode > Open Developer Tool > Application Loader menu.

  1. 确保为任何权利设置了 Info.plist 描述键。这对于 iOS 应用程序是必需的。我的是一个 macOS 应用程序,所以这不适用。

  2. 如果您不是 100% 确定它们有效,请前往 iTunes Connect,并重新创建所有配置文件和代码签名证书。您可以为 Developer 和 Distribution 执行此操作。

  3. 在 Xcode 中,关闭应用程序和任何构建目标的自动代码签名(您可以在完成步骤 #2 和 #4 后尝试在 Xcode 中自动代码签名,但这对我不起作用)。

  4. 转到 Xcode 首选项,然后单击您的开发团队,在出现的工作表中,您应该会在新创建的(在 iTunes Connect 中)代码签名证书和配置文件旁边看到一些“下载”按钮。单击全部。这样您就不会在第 5 步中感到困惑,删除此应用程序的所有其他陈旧配置文件和代码签名身份。

  5. 在每个目标的构建设置中,确保将代码签名的发布构建设置和配置文件设置为上述新创建的代码签名证书和配置文件。

  6. 撞上你的内部版本号。

  7. 深度清理您的项目(Option-Shift-Command-K)。

  8. 归档构建您的应用程序。

  9. 在打开的管理器中,选择新存档的应用程序,然后验证(它总是经过验证,但稍后我仍然会得到 Invalid Binary)。

  10. 导出构建并选择“保存为 Mac App Store 部署”或类似选项。

  11. 出现提示时,使用您之前使用的相同配置文件并保存。

  12. 在 Application Loader 中打开 .pkg,您可以从 Xcode > Open Developer Tool > Application Loader 菜单启动它。

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."

我没有收到有关无效二进制问题的任何电子邮件。相反,我很幸运地使用 iTunes Connect 设置了我的 iPad,因此,就像时钟一样,我在上传应用程序的几分钟内收到通知:“您的应用程序......已更改为无效二进制。”

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.

如果您没有收到这些 Invalid Binary 通知之一,这是一个好兆头。又过了 10-15 分钟后,我查看了 iTunes Connect 门户,我终于可以添加上传的构建并提交以供审核。