xcode 如何解决“错误:无法读取应用程序的 Info.plist(无法加载 DVTFilePath 的信息字典)”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/34280365/
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
How to resolve "error: Failed to read Info.plist of app (Couldn't load Info dictionary for DVTFilePath)"
提问by Tim R.
I'm using Xcode Version 7.1.1 (7B1005)
我使用的是 Xcode 版本 7.1.1 (7B1005)
The iOS app I'm trying to build was produced by duplicating an existing Mac version of the app, and changing the pertinent target OS settings. I've done this before successfully with another app without any major issues. However, the Info.plist file for this app (which was directly copied from the working app) is possibly causing some kind of issue.
我尝试构建的 iOS 应用程序是通过复制该应用程序的现有 Mac 版本并更改相关目标操作系统设置而生成的。我之前用另一个应用程序成功地完成了这件事,没有任何重大问题。但是,此应用程序的 Info.plist 文件(直接从工作应用程序复制)可能会导致某种问题。
- The "Info.plist file" setting in the Xcode Build Settings for the iOS version is set to the correct path. If I set it to a non-working path, I get a different error (ProcessInfoPlistFile reports an error)
- I checked the built app bundle, and it did contain an Info.plist file.
- iOS 版本的 Xcode Build Settings 中的“Info.plist 文件”设置设置为正确的路径。如果我将其设置为非工作路径,则会出现不同的错误(ProcessInfoPlistFile 报告错误)
- 我检查了构建的应用程序包,它确实包含一个 Info.plist 文件。
Here are the errors that my issue produced:
以下是我的问题产生的错误:
replacing existing signature
bundle format unrecognized, invalid, or unsuitable
Command /usr/bin/codesign failed with exit code 1
I worked around the first error by adding --deep
to the codesign flags. After adding that I would get this error:
我通过添加--deep
到协同设计标志来解决第一个错误。添加后,我会收到此错误:
Validate /Users/me/Library/Developer/Xcode/DerivedData/long string of characters/Build/Products/Debug-iphoneos/my\ app\ name.app
cd /Users/me/Perforce/workspace/project/Platforms/OSX
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
export PRODUCT_TYPE=com.apple.product-type.application
builtin-validationUtility /Users/me/Library/Developer/Xcode/DerivedData/long string of characters/Build/Products/Debug-iphoneos/my\ app\ name.app
error: Failed to read Info.plist of app /Users/me/Library/Developer/Xcode/DerivedData/long string of characters/Build/Products/Debug-iphoneos/my app name.app (Couldn't load Info dictionary for <DVTFilePath:0x7f97125bb4b0:'/Users/me/Library/Developer/Xcode/DerivedData/long string of characters/Build/Products/Debug-iphoneos/my app name.app'>)
采纳答案by Tim R.
This issue was occurring because I had a folder named "resources" in my app's root directory. Renaming this folder to "stuff" resolved this error, but is pretty inconvenient because of the way our resources are set up.
出现此问题是因为我的应用程序根目录中有一个名为“resources”的文件夹。将此文件夹重命名为“stuff”解决了此错误,但由于我们的资源设置方式而非常不方便。
I'm guessing iOS has an undocumented "resources" folder in the app folder structure, and adding a "resources" folder to your app conflicts and overwrites some metadata in there.
我猜 iOS 在应用程序文件夹结构中有一个未记录的“资源”文件夹,并将“资源”文件夹添加到您的应用程序冲突并覆盖其中的一些元数据。
The original error I was getting started appearing after I added --deep
to my codesign flags, which was not actually needed.
在我添加--deep
到我的 codesign 标志后,我开始出现的原始错误实际上并不需要。
回答by Litome
I had the same issue (no folder named 'resources' in my case so the problem was elsewhere). Using xCode 8.2.1
我遇到了同样的问题(在我的例子中没有名为“资源”的文件夹,所以问题出在其他地方)。使用 xCode 8.2.1
Solution: Ensure the Info.plist file is listed in the Build Phases -> Copy Bundle Resources section of each one of your targets.
解决方案:确保 Info.plist 文件在每个目标的 Build Phases -> Copy Bundle Resources 部分中列出。
回答by William henderson
For me, restarting my computer fixed the issue. Nothing else worked.
对我来说,重新启动计算机解决了这个问题。没有其他工作。
=/
=/
回答by Shyam
In my case, changing the target device to an iOS simulator while building worked.
就我而言,在构建时将目标设备更改为 iOS 模拟器。
回答by Mussa Charles
The same issue always happens after creating a folder such as the very common one supporting files or any other folderName and put your info.plist file in there. Here is how to fix it: - Project -> Targets -> Select your app -> Build Settings -> Packaging -> Info.plist -> Double tap the old file path and change it to the new file path.
在创建一个文件夹(例如非常常见的支持文件或任何其他文件夹名称)并将您的 info.plist 文件放在那里后,总是会发生同样的问题。以下是修复它的方法: - 项目 -> 目标 -> 选择您的应用 -> 构建设置 -> 打包 -> Info.plist -> 双击旧文件路径并将其更改为新文件路径。
for example, if you created a folder named Supporting Files and moved your info.plist file in there, the new file path should be: - YourAppName/Supporting Files/Info.plist
例如,如果您创建了一个名为 Supporting Files 的文件夹并将您的 info.plist 文件移动到其中,则新文件路径应为: - YourAppName/ Supporting Files/Info.plist
回答by Kuldeep Saxena
Check the target of the Info.plist file by clicking on it.
通过单击检查 Info.plist 文件的目标。