xcode 安装 IPA 导致错误“已添加、修改或删除签名资源”

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

Installing IPA results in error "A signed resource has been added, modified, or deleted"

iphoneiosobjective-cxcodeipa

提问by user2842164

I've recently stumbled upon a rather odd problem with Xcode which occurs when I build an IPA and attempt to install it, I've tried installing using Xcode, iTunes and iPhone Config Utility, all of which give the same error

我最近偶然发现了 Xcode 一个相当奇怪的问题,当我构建 IPA 并尝试安装它时,我尝试使用 Xcode、iTunes 和 iPhone Config Utility 进行安装,所有这些都给出了相同的错误

A signed resource has been added, modified, or deleted.

I can successfully debug the app on my phone using XCode, it's only when I try to install an IPA I see the error.

我可以使用 XCode 在我的手机上成功调试应用程序,只有当我尝试安装 IPA 时才会看到错误。

I've tried unzipping the IPA and running the codesign validation tool which throws up the following response:

我试过解压缩 IPA 并运行 codesign 验证工具,该工具会引发以下响应:

a sealed resource is missing or invalid In architecture: armv7
resource missing:
/Users/dev1/Documents/PoleTester.app/Settings.bundle/._Root.plist

This led me to look at the Settings.bundle file and ensure that it's being included in the build, which it is. Interestingly though, if I remove the Settings.bundle file, build an IPA and attempt to install it on my iPhone the install succeeds, however this of no use as I need the Settings.bundle file installing with the app.

这让我查看了 Settings.bundle 文件并确保它包含在构建中,确实如此。有趣的是,如果我删除 Settings.bundle 文件,构建一个 IPA 并尝试在我的 iPhone 上安装它,安装会成功,但是这没有用,因为我需要随应用程序一起安装 Settings.bundle 文件。

Further investigations on some of my previous XCode projects has shown that I can build an IPA, with the Settings.bundle file included, and successfully install it. However, if I make a simple change to the Settings.bundle file, such as adding or removing a row, build an IPA and then attempt to install it I get the

对我之前的一些 XCode 项目的进一步调查表明,我可以构建包含 Settings.bundle 文件的 IPA,并成功安装它。但是,如果我对 Settings.bundle 文件进行简单的更改,例如添加或删除一行,构建一个 IPA,然后尝试安装它,我会得到

"A signed resource has been added, modified, or deleted" error.

I'm at a bit of a loss as to what's causing this error and why the Settings.bundle file is causing the install to fail.

对于导致此错误的原因以及 Settings.bundle 文件导致安装失败的原因,我有点不知所措。

Has anyone seen this error before or potentially shed some light on what's causing it?

有没有人以前看到过这个错误,或者有没有人了解导致它的原因?

I'm using Xcode 4.6.3and an iPhone 4running iOS 6.1.3.

我使用的是Xcode 4.6.3和运行iOS 6.1.3iPhone 4

回答by MikeyWard

Clean Build Folder (???-K) has resolved this for me 3 out of 3 times.

Clean Build Folder (???-K) 已经为我解决了 3 次中的 3 次这个问题。

回答by joel.d

I just ran into this issue using Xcode 6 beta 6 installing to my iPhone 5 running iOS 8 beta 5. The app I'm building uses a Today extension (aka widget).

我刚刚使用 Xcode 6 beta 6 安装到运行 iOS 8 beta 5 的 iPhone 5 时遇到了这个问题。我正在构建的应用程序使用了 Today 扩展(又名小部件)。

It appears the issue stemmed from my having not set up dependencies properly. I have a third party framework (Alamofire) set up as part of the project as a dependency of the overall project, but not as a dependency of the today widget. I could build fine but when installing to device I would get this "signed resource has been..." error.

看来问题源于我没有正确设置依赖项。我有一个第三方框架 (Alamofire) 作为项目的一部分设置为整个项目的依赖项,但不是作为今天小部件的依赖项。我可以构建得很好,但是在安装到设备时,我会收到此“已签名资源已...”错误。

By adding Alamofire as a dependency of the Today widget this resolved the issue.

通过添加 Alamofire 作为 Today 小部件的依赖项,解决了这个问题。

回答by sduif

It's a bit late but I ran into the exact same issue today with Xcode 5.0.1.

有点晚了,但我今天在 Xcode 5.0.1 上遇到了完全相同的问题。

According to https://developer.apple.com/library/ios/technotes/tn2318/index.html, "the resource missing: my.app/..*" error could be caused by:

https://developer.apple.com/library/ios/technotes/tn2318/的index.html“的资源丢失:my.app/。*。”错误可能是由以下原因引起:

The file prefixed with "._" is considered an AppleDouble file and it can result from copying the uncompressed Xcode project folder onto a non-HFS+ formatted disk. The AppleDouble files must be removed using the 'dot_clean' command. The Xcode project folder is the argument to dot_clean as illustrated below.

以“._”为前缀的文件被视为 AppleDouble 文件,它可能是由于将未压缩的 Xcode 项目文件夹复制到非 HFS+ 格式的磁盘上而产生的。必须使用“dot_clean”命令删除 AppleDouble 文件。Xcode 项目文件夹是 dot_clean 的参数,如下图所示。

Steps I did to resolve this:

我为解决此问题所做的步骤:

  1. Close Xcode
  2. Run "dot_clean /path/to/My_Xcode_Project" in Terminal
  3. Open Xcode again and make a new build
  1. 关闭 Xcode
  2. 在终端中运行“dot_clean /path/to/My_Xcode_Project”
  3. 再次打开Xcode并进行新构建

Oddly enough most of these _* files don't seem to cause any issues except those inside Settings.bundle (Nearly every file in my directory had one, but only after I added Settings.bundle, the IPA failed to install).

奇怪的是,这些 _* 文件中的大多数似乎没有引起任何问题,除了 Settings.bundle 中的那些(几乎我目录中的每个文件都有一个,但只有在我添加 Settings.bundle 之后,IPA 才能安装)。

回答by Ali Raza

I also faced the same issue and this post solved my problem:

我也遇到了同样的问题,这篇文章解决了我的问题:

http://code-ninja.org/blog/2012/04/17/signed-resource-has-been-added-modified-or-deleted/

http://code-ninja.org/blog/2012/04/17/signed-resource-has-been- added-modified-or-deleted/

It turns out that the problem was caused by having special character in the product name – in my case, a ?. Removing the ? from the product name fixed the problem.

事实证明,问题是由产品名称中的特殊字符引起的——在我的例子中,是一个 ?。删除 ? 从产品名称修复了问题。

回答by jmuet

In my case, what helped was adding a bash script into build phases (just before "compile sources"):

就我而言,帮助的是将 bash 脚本添加到构建阶段(就在“编译源”之前):

find ~/Library/Developer/Xcode/DerivedData -name "YouAppName.appex" | xargs -I % find % -type f -maxdepth 1 | xargs rm

What this script does, is to clean files in project's appex dir (e.g. assets), but leaving sub-directories (e.g. compiled storyboard). In effect, using this script while building is much faster to execute than full project clean.

该脚本的作用是清除项目的 appex 目录中的文件(例如资产),但保留子目录(例如已编译的故事板)。实际上,在构建时使用此脚本比完整项目清理执行速度要快得多。