xcode 尝试在 iPhone 上调试应用程序时收到消息“已添加、修改或删除已签名资源”

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

Receive message "A signed resource has been added, modified, or deleted" when trying to debug an App on iPhone

iphonexcodeiphone-sdk-3.2

提问by jessecurry

While attempting to debug a build created using the 3.2 SDK on an iPhone device I receive the message "A signed resource has been added, modified, or deleted.".

尝试在 iPhone 设备上调试使用 3.2 SDK 创建的构建时,我收到消息“已添加、修改或删除签名资源。”。

I can clean, rebuild, then install with no error, but if I try to install without cleaning the error shows.

我可以清理,重建,然后安装没有错误,但如果我尝试安装而不清理错误显示。

Anyone have an idea as to what might be causing this?

任何人都知道可能导致这种情况的原因?

采纳答案by Jernej Strasner

I found a workaround for the bug.

我找到了解决该错误的方法。

If you delete the .app file in build/Debug-iphoneos/ before building for the device, the app gets installed without errors. And there is a simple way to do that before every build.

如果在为设备构建之前删除 build/Debug-iphoneos/ 中的 .app 文件,则应用程序安装时不会出错。在每次构建之前,有一种简单的方法可以做到这一点。

Make sure you have selected "Device" in the dropdown overview menu. In XCode go to Project > New target... Then find "Shell Script target" under MacOSX/Other Name it and add it to the current project

确保您在下拉概览菜单中选择了“设备”。在 XCode 中,转到 Project > New target... 然后在 MacOSX/Other 下找到“Shell Script target”并将其添加到当前项目中

Now, in the left navigation panel, under targets, expand your newly created target and double-click on Run Script. In the window that opens replace "# shell script goes here" with "rm -fr build/Debug-iphoneos/*.app" (without the quotes). Now open your main target preferences and under Direct Dependencies add your newly created target. Build and Go! :)

现在,在左侧导航面板中的目标下,展开新创建的目标并双击运行脚本。在打开的窗口中,用“rm -fr build/Debug-iphoneos/*.app”(不带引号)替换“#shell script go here”。现在打开您的主要目标首选项,并在 Direct Dependencies 下添加您新创建的目标。建造并开始!:)

回答by Tibidabo

This error occurs when there is a special character in the Product Name. In my case it was a "?"

Product Name 中特殊字符时会发生此错误。就我而言,它是一个“?”

If you change the Product Name it automatically updates the "Bundle Name" and "Bundle Display Name" so it is often the best choice to rename an app.

如果您更改产品名称,它会自动更新“捆绑名称”和“捆绑显示名称”,因此通常是重命名应用程序的最佳选择。

If you want to include special characters in the app name you have to manually rename the "Bundle Name" and "Bundle Display Name"

如果您想在应用程序名称中包含特殊字符,您必须手动重命名“Bundle Name”和“Bundle Display Name”

Bundle Name: This is the actual app bundle name in the file system such as "Awesome App.app". It is generally not visible to the user.

Bundle Name:这是文件系统中的实际应用程序包名称,例如“Awesome App.app”。它通常对用户不可见。

Bundle Display Name: This is a short name displayed under the app iconon the device. Since the bundle name would be truncated to "Awes…tion" you have the option to have a shorter name which fits better such as "Awesome App". It should be similar to the App Store name (set in iTunes Connect)

捆绑显示名称:这是设备上应用程序图标下显示简称。由于捆绑包名称将被截断为“Awes...tion”,因此您可以选择使用更合适的较短名称,例如“Awesome App”。它应该类似于 App Store 名称(在 iTunes Connect 中设置)

回答by davidcann

This is pretty clearly a bug in the 3.2 SDK, but I don't want to downgrade. I've found that doing a Clean by pushing Command+Shift+K, then Returnis pretty fast before pushing Command+Rto build.

这很明显是 3.2 SDK 中的一个错误,但我不想降级。我发现通过 push 进行 Clean Command+Shift+K,然后Return在推送Command+R构建之前非常快。

回答by Stanislav S.

Xcode 8, reason of the "A signed resource has been added, modified, or deleted." was that target was signed with an enterprise provision profile.

Xcode 8,“已添加、修改或删除已签名资源”的原因。该目标是否与企业供应配置文件一起签署。

回答by russbishop

This can have several causes. The fastest way to figure out what is causing it is to go into Xcode, Window menu, Devices, then click the reveal button at the bottom of the pane to show the Console. Now attempt to run. You should see log output that names the specific files it is complaining about.

这可能有多种原因。找出导致它的原因的最快方法是进入 Xcode,窗口菜单,设备,然后单击窗格底部的显示按钮以显示控制台。现在尝试运行。您应该会看到命名它所抱怨的特定文件的日志输出。

Most of the solutions previously posted are just artificial ways of getting Xcode to regenerate the contents of the build folder and/or re-sign the files.

之前发布的大多数解决方案只是让 Xcode 重新生成构建文件夹的内容和/或重新签署文件的人为方法。

In my case, my WatchKit extension was somehow acquiring references to Cocoapods frameworks that were only targeted toward the main app so they got signed during the build, then pruned later (as they were not used). Then on device, iOS complained that they were missing from the .appex folder for the extension. I ended up not needing any pods in the extension so I just removed them all and removed the extension as a target, then did some minor cleanup to remove the pod-related debris left in the build steps. Now everything works perfectly.

就我而言,我的 WatchKit 扩展以某种方式获取了对 Cocoapods 框架的引用,这些框架仅针对主应用程序,因此它们在构建过程中被签名,然后被修剪(因为它们没有被使用)。然后在设备上,iOS 抱怨扩展名的 .appex 文件夹中缺少它们。我最终不需要扩展中的任何 Pod,所以我只是将它们全部删除并将扩展作为目标删除,然后进行了一些小的清理以删除构建步骤中留下的与 Pod 相关的碎片。现在一切正常。

回答by babalu

In my case, it happened when no changes were made. Make a change to any file and run again.

就我而言,它发生在没有进行任何更改的情况下。对任何文件进行更改并再次运行。

回答by drekka

(SOLVED) This is a weird one. I tried everything I could find. Eventually I changed the product name from "Unit Tests (device)" to "Device Unit Tests" - removing the brackets. Now everything works. The spaces in it appear to be fine.

(已解决)这是一个奇怪的问题。我尝试了我能找到的一切。最终,我将产品名称从“单元测试(设备)”更改为“设备单元测试”——去掉括号。现在一切正常。里面的空格好像没问题。

Previously on stackoverflow: I've just run into this bug with two static library projects. One builds and tests using the GHUnit test runner on the device without a problem. The other projects will not install and gets this error. That means it's something thats different between these two projects. I've so far tried wiping the build directory, taking spaces out of the executable name, and various clean and builds as suggested here.

以前在 stackoverflow 上:我刚刚在两个静态库项目中遇到了这个错误。可以在设备上使用 GHUnit 测试运行器进行构建和测试,没有任何问题。其他项目将无法安装并出现此错误。这意味着这两个项目之间有所不同。到目前为止,我已经尝试擦除构建目录,从可执行文件名称中取出空格,并按照此处的建议进行各种清理和构建。

回答by DaVinciWare

I could solved by changing project name.

我可以通过更改项目名称来解决。

[project]-[Rename] menu. "phase1 (new)" -> "pahse1"

回答by Nils

Same for me, thought it has something to do with multiple targets etc. because I changed a lot there. But it's highly possible that it's a Bug in the 3.2.2 release since I did not test extensively in this sdk version before the massive target changes in my project.

对我来说也是一样,认为它与多个目标等有关。因为我在那里改变了很多。但是很有可能它是 3.2.2 版本中的一个 Bug,因为在我的项目中的大量目标更改之前,我没有在这个 sdk 版本中进行广泛的测试。

回答by Nils

solved my issue!!!

解决了我的问题!!!

I found out by accident that somehow a space " " found it's way into the Product Name of my app so it was called "First Second.app" instead of "FirstSecond.app". After deleting the space the issue was gone!

我偶然发现一个空格“ ”发现它进入了我的应用程序的产品名称,所以它被称为“First Second.app”而不是“FirstSecond.app”。删除空间后问题就解决了!

I changed it here: right click on target Get Info Build Tab Packaging Section Product Name <- The name here will be used for the bundle (.app) name

我在这里更改了它:右键单击目标 Get Info Build Tab Packaging Section Product Name <- 这里的名称将用于包 (.app) 名称

Hope this helps, let me know!

希望这有帮助,让我知道!

Cheers, nils

干杯,零