Xcode 的构建和存档不起作用

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

Xcode's Build and Archive not working

iphonexcodecocoa-touchxcode3.2

提问by olivaresF

The current issue I'm having is that Build and Archive will build my current target but after it's finished building, a pop-up will appear with the message:

我目前遇到的问题是 Build and Archive 将构建我当前的目标,但在构建完成后,会出现一个带有消息的弹出窗口:

"The operation couldn't be completed. No such file or directory"

“操作无法完成。没有那个文件或目录”

I have reinstalled Xcode (3.2.3 with SDK 4.0), rebooted my machine, cleaned the cache, cleaned the project, manually deleted the project build directory. Nothing has worked.

我已经重新安装了 Xcode(3.2.3 和 SDK 4.0),重新启动了我的机器,清理了缓存,清理了项目,手动删除了项目构建目录。没有任何效果。

I've also checked ~/Library/MobileDevice/Archived Applicationsand it is empty.

我也检查过~/Library/MobileDevice/Archived Applications,它是空的。

Any ideas?

有任何想法吗?

p.s. This is driving me crazy!

ps 这让我发疯!

采纳答案by Malcolmr

I had this problem and the solution that was recommended to me was:

我遇到了这个问题,向我推荐的解决方案是:

  1. Open your Xcode project
  2. Select Unity-iPhone in targets (Double click so it opens the info)
  3. Find "Generate Debug Symbols" and check it on. (Just Search for it in the search field)
  1. 打开你的 Xcode 项目
  2. 在目标中选择 Unity-iPhone(双击打开信息)
  3. 找到“生成调试符号”并选中它。(只需在搜索字段中搜索它)

This worked for me, but I still don't understand why it was necessary.

这对我有用,但我仍然不明白为什么有必要。

回答by Mason Lee

The error The operation couldn't be completed. No such file or directoryalso occurs in XCode 4.0 GM preview if you do not change identityto "Don't Re-sign" after selecting (Archives) Sharein the Organizer

错误操作无法完成。如果您在选择(Archives) Sharein the Organizer后不将身份更改为“Don't Re-sign” ,则 XCode 4.0 GM 预览中也不会出现此类文件或目录

回答by Mugunth

All answers failed. Best solution, drag the .app bundle to iTunes and reveal the app in Finder. Boom! you get your ipa there.

所有答案都失败了。最佳解决方案,将 .app 包拖到 iTunes 并在 Finder 中显示该应用程序。繁荣!你在那里拿到你的ipa。

回答by romrom

Had the same issue and none of the mentions solutions worked. I finally found the problem when I tried to directly sign the app with the adhoc profile: it told me that I had twice a distribution profile in my keychain. I deleted the old one, then compiled again with the dev profile, and then archiving with the adhoc profile and it worked.

有同样的问题,没有提到的解决方案有效。当我尝试使用临时配置文件直接签署应用程序时,我终于发现了问题:它告诉我,我的钥匙串中有两次分发配置文件。我删除了旧的,然后使用开发配置文件再次编译,然后使用临时配置文件归档并且它起作用了。

回答by keno

Since it only seems to happen with your release configuration, double check the "Build Locations" values in your project settings for the release configuration.

由于它似乎只发生在您的发布配置中,因此请仔细检查项目设置中发布配置的“构建位置”值。

  • Check the paths in the "build locations" to make sure they exist
  • Check the permissions for those paths
  • Try doing just a build (no archiving) for your release configuration
  • 检查“构建位置”中的路径以确保它们存在
  • 检查这些路径的权限
  • 尝试为您的发布配置做一个构建(不归档)

Also keep an eye on your build results window during the build to see if there were any warnings during the signing and packaging stages that could give you clues

还要注意构建过程中的构建结果窗口,看看在签名和打包阶段是否有任何可以为您提供线索的警告

回答by ergosys

Longshot answer - do you have any unusual characters in your project path? This release note indicates it can cause problems:

Longshot 答案 - 您的项目路径中是否有任何不寻常的字符?此发行说明表明它可能会导致问题:

While most known cases have been taken care of, having a space, comma, slash, backslash, tilde, or other character special to the Unix shell in the directory name of any parent folder of your project can cause your project build to fail in unexpected ways.

虽然大多数已知情况已得到处理,但在项目的任何父文件夹的目录名称中包含空格、逗号、斜杠、反斜杠、波浪号或其他 Unix shell 特殊字符可能会导致项目构建意外失败方法。

回答by Magnus O.

If you have a 3:rd party SDK you need to add "$(SDKROOT)/ResourceRules.plist" to the “Code Signing Resource Rules Path” key in the targets build settings.

如果您有 3:rd 方 SDK,则需要将“$(SDKROOT)/ResourceRules.plist”添加到目标构建设置中的“代码签名资源规则路径”键。

回答by drct

I solved this problem by exchanging the wildcard adhoc distribution profile I was using for an app specific adhoc distribution profile.

我通过交换我用于应用程序特定的临时分发配置文件的通配符临时分发配置文件解决了这个问题。

回答by Marcus S. Zarra

Run the Console app and see what information is being spit out there. That should give us more insight into the issue.

运行控制台应用程序,看看有哪些信息被吐出。这应该让我们更深入地了解这个问题。

回答by TechZen

Of the top of my head, I would check permissions. Some code reports permissions problems as there being no file/folder. Check the Console log. You will sometimes find more info there.

在我的头顶上,我会检查权限。一些代码报告权限问题,因为没有文件/文件夹。检查控制台日志。您有时会在那里找到更多信息。