xcode 错误:文件“Info.plist”无法打开,因为没有这样的文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/37675044/
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
Error: The file “Info.plist” couldn’t be opened because there is no such file
提问by Lalit
I have move my project from another machine with latest Xcode installed in it. But now when i'm running project it giving me error as
我已经从另一台安装了最新 Xcode 的机器上移动了我的项目。但是现在当我运行项目时,它给了我错误
Info.plist:0: error: reading data: The file “Info.plist” couldn't be opened because there is no such file.
Info.plist:0: error: reading data: 无法打开文件“Info.plist”,因为没有这样的文件。
Previously project running with no issue but now on new system project has error. Previous version was Xcode 7.3.
以前项目运行没有问题,但现在新系统项目有错误。以前的版本是 Xcode 7.3。
回答by Ankit
Please try either of the two ways :-
请尝试以下两种方式之一:-
First Try :
第一次尝试 :
The solution for this particular instance of the error was “Info.plist couldn't be opened because there is no such file” was that I had deleted all of the files in the "Project Tests" folder, but was still had "Project Tests" listed under my targets. After deleting the "tests" target, the project built successfully.
这个特定错误实例的解决方案是“Info.plist 无法打开,因为没有这样的文件”是我已经删除了“项目测试”文件夹中的所有文件,但仍然有“项目测试” “列在我的目标下。删除“tests”目标后,项目构建成功。
Last Try :
最后一次尝试:
1) Go to :- App Target 2) See the Identify ---and choose the Plist
1)转到:- App Target 2)查看身份---并选择Plist
回答by Confused
This error happens when the system can not locate the info.plist file from your file hierarchy.
当系统无法从您的文件层次结构中找到 info.plist 文件时,就会发生此错误。
Consider this situation:I moved the info.plist file to the group "Others" like this..
考虑这种情况:我像这样将 info.plist 文件移到“其他”组中。
Goto Target - Tap Build Settings - Find "info.plist"
转到目标 - 点击构建设置 - 找到“info.plist”
Here, the system will search the info.plist in AddModifyDelete folder. But the actual file is under AddModifyDelete/Others. So, change it to AddModifyDelete/Others/info.plist
在这里,系统将搜索 AddModifyDelete 文件夹中的 info.plist。但实际文件在 AddModifyDelete/Others 下。因此,将其更改为 AddModifyDelete/Others/info.plist
Now it should work!!
现在它应该工作了!!
Note:This is also applicable to entitlements file. We should define the right path for both info.plist & entitlements file to avoid this error.
注意:这也适用于权利文件。我们应该为 info.plist 和 entitlements 文件定义正确的路径以避免这个错误。
回答by NilamK
Error: The file “Info.plist” couldn't be opened because there is no such file. This error occurs when you change the location of the Info.plist file. To fix this issue, follow the below steps.
错误:文件“Info.plist”无法打开,因为没有这样的文件。当您更改 Info.plist 文件的位置时会发生此错误。要解决此问题,请按照以下步骤操作。
- Go to the navigator pane.
- Click on error symbol located near to the project name.
- It will open the analyze screen.
- Click on Choose Info.plist file.
- Select Info.plist and click on choose button.
- Click on product option and clean the project.
- 转到导航器窗格。
- 单击位于项目名称附近的错误符号。
- 它将打开分析屏幕。
- 单击选择 Info.plist 文件。
- 选择 Info.plist 并单击选择按钮。
- 单击产品选项并清理项目。
回答by yuanjilee
Or you can try
或者你可以试试
Maybe your plist has incorrect format, because of a conflict from git pull, so you should open your .plist file with text editor and resolve the conflict, and then reopen your project with Xcode, everything is OK.
可能你的 plist 格式不正确,因为 git pull 的冲突,所以你应该用文本编辑器打开你的 .plist 文件并解决冲突,然后用 Xcode 重新打开你的项目,一切正常。
回答by user10375102
use these commands in terminal 1.pod deintegrate 2.pod clean 3.pod install
在终端 1.pod deintegrate 2.pod clean 3.pod install 中使用这些命令