Xcode iOS 管理器提交到应用商店产生“存档无效”错误

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

Xcode iOS organizer submit to app store yields "The archive is invalid" error

iphonexcodeios4organizer

提问by Dobler

I just switched from Xcode 3 to 4. When I attempt to upload an app that I have archived to the organizer, I receive this error:

我刚刚从 Xcode 3 切换到 4。当我尝试上传已存档到组织者的应用程序时,我收到此错误:

The archive is invalid. /var/folders/.../app.ipa does not exist.

存档无效。/var/folders/.../app.ipa 不存在。

archive is invalid. app.ipa does not exist.

存档无效。 app.ipa 不存在。

This happens after I log in to itunes connect, select the application to update and select next. I am not sure where to begin trying to figure out what is causing this error. Please let me know if I am leaving out anything that would be useful for diagnosing. Thanks

这发生在我登录到 iTunes Connect 后,选择要更新的应用程序并选择下一步。我不确定从哪里开始试图找出导致此错误的原因。如果我遗漏了对诊断有用的任何内容,请告诉我。谢谢

采纳答案by Dobler

Okay, so when you install the Xcode 4 package, make sure you have the "Unix Tools" option selected. This was the problem in my case.

好的,所以当您安装 Xcode 4 软件包时,请确保您选择了“Unix 工具”选项。这就是我的问题。

回答by Simen ?ian Gjermundsen

I just faced this problem myself, and I seem to have found a solution to it. Even though the correct provisioning profile seems to be selected, it might not be.

我自己刚刚遇到了这个问题,我似乎已经找到了解决方案。即使似乎选择了正确的配置文件,也可能没有。

Try to manually navigate the list of possible provisioning profiles and select the correct one. Do not leave the setting on automatic selection.

尝试手动导航可能的配置文件列表并选择正确的配置文件。不要将设置保留在自动选择上。

In the "Identity:"-list, make sure it does not say "Currently matches...". Manually select the correct one yourself.

在“身份:”-列表中,确保它没有显示“当前匹配...”。自己手动选择正确的。

That should fix the problem and you should be able to upload to the AppStore.

这应该可以解决问题,您应该可以上传到 AppStore。

回答by arlomedia

If you are running an Xcode beta version (Apple calls it a "developer preview") you will get this error because you're not allowed to submit apps from a beta version. This restriction is not mentioned in the Read Me file or on the Xcode download page. To submit an app, you will need to uninstall Developer Tools, then reinstall the latest non-beta version, then restart your computer.

如果您运行的是 Xcode 测试版(Apple 称之为“开发者预览版”),您将收到此错误,因为您不允许提交测试版的应用程序。Read Me 文件或 Xcode 下载页面中未提及此限制。要提交应用程序,您需要卸载开发人员工具,然后重新安装最新的非测试版,然后重新启动计算机。

Here's the command-line command to uninstall:

这是要卸载的命令行命令:

sudo /Developer/Library/uninstall-devtools --mode=all

回答by par

  1. Quit Xcode
  2. With a text editor open the file YourProject.xcodeproj/project.pbxproj
  3. Delete all lines containing PROVISIONING_FILE =
  4. Delete all lines containing CODE_SIGN_IDENTITY =
  5. Save & close project.pbxproj
  6. Reopen your project in Xcode
  7. Clean the project
  8. In the Build Settings pane choose the correct code signing identity
  9. Rebuild
  1. 退出 Xcode
  2. 使用文本编辑器打开文件 YourProject.xcodeproj/project.pbxproj
  3. 删除所有包含 PROVISIONING_FILE = 的行
  4. 删除所有包含 CODE_SIGN_IDENTITY = 的行
  5. 保存并关闭 project.pbxproj
  6. 在 Xcode 中重新打开您的项目
  7. 清理项目
  8. 在 Build Settings 窗格中选择正确的代码签名标识
  9. 重建

回答by adjwilli

I recently switched to a new MacBook Pro and had XCode 4 installed from a Time Machine drive via the Migration Assistant.

我最近切换到新的 MacBook Pro,并通过迁移助手从 Time Machine 驱动器安装了 XCode 4。

Re-installing XCode 4 with the Unix Tools fixed it.

使用 Unix 工具重新安装 XCode 4 修复了它。

For some reason those files weren't getting copied across with Migration Assistant.

出于某种原因,这些文件没有被迁移助手复制。

回答by oscarm

I had the same issue for both TestFlight and App Store. The solution for me was to archive the app, and in the organizer select "Don't sign" when you try to validate/submit or share (in the case of TestFlight).

我对 TestFlight 和 App Store 都遇到了同样的问题。我的解决方案是存档应用程序,并在您尝试验证/提交或共享(在 TestFlight 的情况下)时在组织者中选择“不签名”。

Hope this helps.

希望这可以帮助。

回答by Martin Crisp

I tried most of the ideas above, and they did not work for me, likely because I am using he Appcelerator Titanium platform. I did however delete the Build directory and re-built the product and it passed the validation and I was able to upload the binary to the app store.

我尝试了上面的大部分想法,但它们对我不起作用,可能是因为我使用的是 Appcelerator Titanium 平台。然而,我确实删除了 Build 目录并重新构建了产品,它通过了验证,我能够将二进制文件上传到应用程序商店。

回答by caliopigio

In my case this has nothing to do with Xcode or the unix tools. Indeed I happend to had too many distribution certificates (Why? I don't know). Deleted all of them but one, code sign with this one, re code sign it while validating and submit it with no errors. I hop this help.

就我而言,这与 Xcode 或 unix 工具无关。事实上,我碰巧有太多的分发证书(为什么?我不知道)。删除了所有这些,除了一个,用这个进行代码签名,在验证时重新对其进行代码签名,并且没有错误地提交。我跳这个帮助。

回答by Chris

A good way to test is to run the build from the command line. Change to your project folder and run 'xcodebuild' and look carefully at the outputs, especially around the 'codesign' command.

一个很好的测试方法是从命令行运行构建。切换到您的项目文件夹并运行“xcodebuild”并仔细查看输出,尤其是在“codebuild”命令周围。

I did this and discovered the following:

我这样做并发现了以下内容:

architecture armv7 object: /Users/chris/Documents/x/x/build/Release-iphoneos/x.app/x malformed object
object file format invalid or unsuitable

So it isn't a solution, but it at least lets you zero in on what the problem is. Anyway, for me, looks like an architecture config error.

所以这不是一个解决方案,但它至少可以让您将问题归零。无论如何,对我来说,看起来像是架构配置错误。

Update - to fix this problem, i replaced the copy of codesign_allocate in my /usr/bin folder with the one in /Developer/somewhere and that fixed it.

更新 - 为了解决这个问题,我将 /usr/bin 文件夹中的 codesign_allocate 副本替换为 /Developer/somewhere 中的副本并修复了它。

回答by Giammy

The same happened to me. My mistake was I had certificates with similar names (like "Provisioning Profile of Giammy", "Profile for Provisioning of Giammy"...).

我也遇到了同样的情况。我的错误是我有类似名称的证书(例如“Giammy 的配置文件”、“Giammy 的配置文件”...)。

Running "Archive" from XCode 4.0 and then "Validate..." from the Organizer I faced the "app.ipa does not exist" issue. The problem was that I selected the wrong certificate from those with similar names. The "Archive" phase worked good but the archive did not pass the validation.

从 XCode 4.0 运行“Archive”,然后从 Organizer 运行“Validate...” 我遇到了“app.ipa 不存在”的问题。问题是我从名称相似的证书中选择了错误的证书。“存档”阶段运行良好,但存档未通过验证。

Solution: just picked up the correct provisioning profile in the "Archive" phase.

解决方案:刚刚在“存档”阶段选择了正确的配置文件。

Lesson learned: check twice the provisioning profile name!

经验教训:检查两次配置文件名称!