简体   繁体   English

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

[英]Installing IPA results in error “A signed resource has been added, modified, or deleted”

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并运行代码签名验证工具,该工具会引发以下响应:

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. 这导致我查看了Settings.bundle文件并确保它包含在构建中,它就是这样。 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文件,构建一个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. 对我之前的一些XCode项目的进一步调查表明,我可以构建一个包含Settings.bundle文件的IPA,并成功安装它。 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 但是,如果我对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.3 and an iPhone 4 running iOS 6.1.3. 我正在使用Xcode 4.6.3和运行iOS 6.1.3iPhone 4

清洁构建文件夹(⌘⌥⇧-K)已经为我解决了3次中的3次。

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扩展(aka widget)。

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. 我将第三方框架(Alamofire)设置为项目的一部分,作为整个项目的依赖项,但不作为今天小部件的依赖项。 I could build fine but when installing to device I would get this "signed resource has been..." error. 我可以建立好,但在安装到设备时,我会得到这个“签名资源已...”错误。

By adding Alamofire as a dependency of the Today widget this resolved the issue. 通过添加Alamofire作为Today小部件的依赖,这解决了这个问题。

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. 带有“._”前缀的文件被视为AppleDouble文件,它可能是因为将未压缩的Xcode项目文件夹复制到非HFS +格式化的磁盘上。 The AppleDouble files must be removed using the 'dot_clean' command. 必须使用'dot_clean'命令删除AppleDouble文件。 The Xcode project folder is the argument to dot_clean as illustrated below. Xcode项目文件夹是dot_clean的参数,如下所示。

Steps I did to resolve this: 我做的步骤解决了这个问题:

  1. Close Xcode 关闭Xcode
  2. Run "dot_clean /path/to/My_Xcode_Project" in Terminal 在终端中运行“dot_clean / path / to / My_Xcode_Project”
  3. Open Xcode again and make a new build 再次打开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才能安装)。

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. 从产品名称修复了问题。

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 (eg assets), but leaving sub-directories (eg compiled storyboard). 这个脚本的作用是清理项目的appex目录(例如资产)中的文件,但保留子目录(例如编译的故事板)。 In effect, using this script while building is much faster to execute than full project clean. 实际上,在构建时使用此脚本比完整项目清理要快得多。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM