简体   繁体   English

Info.plist 实用程序错误:“Info.plist 无法打开,因为没有这样的文件”

[英]Info.plist Utility Error: “Info.plist couldn't be opened because there is no such file”

I'm running into what seems to be common error, in that Xcode can't seem to find my 'Info.plist' file.我遇到了似乎是常见的错误,因为 Xcode 似乎找不到我的“Info.plist”文件。

I've checked the answers to these two StackOverflow questions ( Could not read from Info.plist and Objective C/Xcode error: The file “Info.plist” couldn't be opened because there is no such file )...I am using a relative path, and the plist file is in the correct absolute location.我已经检查了这两个 StackOverflow 问题的答案( 无法从 Info.plistObjective C/Xcode 错误中读取:无法打开文件“Info.plist”,因为没有这样的文件)......我是使用相对路径,并且 plist 文件位于正确的绝对位置。 The type and location are correct as shown in the image below:类型和位置正确,如下图所示:

路径

My biggest concern is that this is now happening on multiple projects, including one I ran successfully just a few hours ago!我最担心的是,这种情况现在发生在多个项目中,包括我几个小时前成功运行的一个! Does anyone know how to solve this???有谁知道如何解决这个问题???

EDIT I've also tried reinstalling XCODE and replacing the plist file.编辑我也试过重新安装 XCODE 并替换 plist 文件。 Xcode still can't find 'info.plist'. Xcode 仍然找不到“info.plist”。

NOTE I wanted to add that this was for Xcode 6.2.X (I can't remember which version number exactly, but it was pre-Xcode 6.3.X).注意我想补充一点,这是针对 Xcode 6.2.X(我不记得确切的版本号,但它是 Xcode 6.3.X 之前的版本)。

I also face the similar issue in xcode 7.0 but none of the above Solutions Worked for me, at last I get a chance to solved this issue我在 xcode 7.0 中也遇到了类似的问题,但以上解决方案都不适合我,最后我有机会解决这个问题

  1. Go to: App Target前往:应用目标
  2. See the Identify and choose the Plist查看识别并选择 Plist

See the screenshot also另请参阅屏幕截图

在此处输入图片说明

Enjoy享受

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.这个特定错误实例的解决方案是“Info.plist 无法打开,因为没有这样的文件”是我已经删除了“项目测试”文件夹中的所有文件,但仍然有“项目测试” “列在我的目标下。 After deleting the "tests" target, the project built successfully.删除“tests”目标后,项目构建成功。

I faced similar kind of situation when I updated my XCode to 6.1.当我将 XCode 更新到 6.1 时,我遇到了类似的情况。 My project contained Info.plist but I got this error: "The file “Info.plist” couldn't be opened because there is no such file."我的项目包含 Info.plist,但出现此错误:“无法打开文件“Info.plist”,因为没有此类文件。 Therefore, I looked up to the targets of my application which were: "App" & "AppTests".因此,我查看了我的应用程序的目标:“App”和“AppTests”。 I checked for the 'Packaging' field in 'Build Settings' tab.我检查了“构建设置”选项卡中的“包装”字段。

Target: 'App' -> 'Build Settings' -> 'Packaging' -> 'Info.plist file(field)' - the location should be correct目标:'App' -> 'Build Settings' -> 'Packaging' -> 'Info.plist file(field)' - 位置应该是正确的

Target: 'AppTests' -> 'Build Settings' -> 'Packaging' -> 'Info.plist file(field)' - the location must be something like this: 'AppTests/Info.plist'.Keep this field empty.Delete the location.目标:'AppTests' -> 'Build Settings' -> 'Packaging' -> 'Info.plist file(field)' - 位置必须是这样的:'AppTests/Info.plist'。保持这个字段为空。删除那个地点。

It seems that Apple is checking this location by default for finding Info.plist. Apple 似乎默认检查此位置以查找 Info.plist。 Clean & Build your project.清理并构建您的项目。 It will work.它会起作用。 Worked for me.为我工作。

XCode 10 and 11 XCode 10 和 11

I know it's been a while, but I faced the same issue today, and the answers I've found weren't very clear for me, so I decided to make an instruction with screenshots.我知道已经有一段时间了,但我今天遇到了同样的问题,我找到的答案对我来说不是很清楚,所以我决定用截图来说明。

1) First, open the right-hand panel in xcode and click on your .plist file: 1) 首先,在 xcode 中打开右侧面板并单击您的 .plist 文件:

在此处输入图片说明

2) Second, choose Relative to project location on the right-hand panel and copy the link just below it: 2) 其次,选择右侧面板上的Relative to project位置并复制其正下方的链接:

在此处输入图片说明

3) Third, go to the main project settings, choose your target and click on the Build settings tab: 3) 第三,转到主项目设置,选择您的目标并单击构建设置选项卡:

在此处输入图片说明

4) And finally, type Info.plist in the search field, double-click on the existing path and paste the link you have copied earlier: 4) 最后,在搜索字段中输入Info.plist ,双击现有路径并粘贴您之前复制的链接:

在此处输入图片说明

In the end, clean the project Shift + Cmd + K and re-run.最后,清理项目Shift + Cmd + K并重新运行。

For me, the anwser for this issue was:对我来说,这个问题的答案是:

1.Turn off Xcode 1.关闭Xcode

2.Go to ./Users/You/Library/Developer/Xcode/DerivedData 2.转到./Users/You/Library/Developer/Xcode/DerivedData

3.Delete everything from this folder 3.删除此文件夹中的所有内容

4.Run Xcode 4.运行Xcode

5.Build&Clean 5.构建和清洁

Xcode version: 6.4 (6E35b) Xcode 版本:6.4 (6E35b)

在我的情况下,我编辑了我的 xcode 项目文件夹名称,因此这是在更改文件夹的新名称(项目 -> 目标 -> 构建设置 -> 打包 -> Info.plist 名称)然后正常工作后发生的。

go to targets.去目标。 right click on the test target.右键单击测试目标。 yourProjectTests and delete it yourProjectTests 并删除它

As answered by @narner (answer marked as correct), yes it can make code work.正如@narner 所回答的(答案标记为正确),是的,它可以使代码工作。 But here is something better to solve the problem.但这里有更好的方法来解决这个问题。

My suggestion is that instead of delete tests targets, better if we change the path of info.plist under tests target.我的建议是,与其删除测试目标,不如更改测试目标下的 info.plist 路径。

Simple steps:-简单步骤:-

In project, click on the project file -> ProjectNameTests (under targets) ->Build settings->Packaging->Info.plist Here you change the path of file.在项目中,点击项目文件-> ProjectNameTests (在targets下)->Build settings->Packaging->Info.plist 这里你改变文件的路径。

Relocate the files by double clicking on this icon:通过双击此图标重新定位文件:

在此处输入图片说明

I had this issue too for the past couple hours.过去几个小时我也遇到了这个问题。 I had downloaded my github project from an earlier version.我从早期版本下载了我的 github 项目。 the search paths seem to have gotten confused and needed to be explicitly told where the files were located.搜索路径似乎变得混乱,需要明确告知文件所在的位置。

if you change info.plist location from project to a folder inside the app then you will get this error i was facing same error and error resolved by this way如果您将info.plist位置从项目更改为应用程序内的文件夹,那么您将收到此错误我遇到了同样的错误,错误已通过这种方式解决

 Select your app and from Targets yourApp > Build Settings > Packaging > 
 Info.Plist and change that path

One of the most weird issue that I have faced.我遇到的最奇怪的问题之一。 In my case I do not have any file missing, I cleared the derived data, cleared the modular cache, cleaned the project multiple times, restarted my xcode, but nothing worked for me.在我的情况下,我没有丢失任何文件,我清除了派生数据,清除了模块化缓存,多次清除了项目,重新启动了我的 xcode,但对我没有任何作用。 At the end I restarted my computer with the only hope to resolve this issue which surprisingly worked for me!!!最后我重新启动了我的电脑,唯一的希望是解决这个问题,这对我来说非常有效!!!

This is my first post, but I have been a dedicated student here for a while now.这是我的第一篇文章,但我在这里已经有一段时间了。

For me the problem was a framework that I added.对我来说,问题是我添加的一个框架。 I know because when adding it, I got the problem and I test constantly during development on the simulator and I opened the simulator log and found the info.plist problem was solely with the framework I added.我知道是因为在添加它时,我遇到了问题,我在模拟器上的开发过程中不断测试,我打开模拟器日志,发现 info.plist 问题仅与我添加的框架有关。 To double check, I deleted the framework and all references to it and tried building to the simulator again and everything went back to normal.为了仔细检查,我删除了框架和对它的所有引用,并尝试再次构建到模拟器,一切都恢复正常。 So, after I tried everything that I read here and in other posts and not being able to fix the problem, I felt like throwing in the towel, but on my last attempt I did the following and it worked 24 hours after:所以,在我尝试了我在这里和其他帖子中读到的所有内容并且无法解决问题后,我觉得认输,但在我最后一次尝试时,我做了以下操作,并在 24 小时后工作:

  1. I removed references and completely deleted the framework in question from my Xcode project.我删除了引用并从我的 Xcode 项目中完全删除了有问题的框架。

  2. Opened Simulator, chose Simulator/Reset Content and Settings..打开模拟器,选择模拟器/重置内容和设置..

  3. In Xcode, I did a Product/Clean and while holding alt down, did a Product/Clean Build Folder.在 Xcode 中,我做了一个 Product/Clean 并在按住 alt 的同时,做了一个 Product/Clean Build 文件夹。 I think if you do the latter of the 2, Product/Clean is unnecessary, but I was grabbing at straws我认为如果你做 2 中的后者,产品/清洁是不必要的,但我正在抓住稻草

  4. To add the framework back to the project, I chose the target/Build Phases and added a new Copy Files phase.为了将框架添加回项目,我选择了目标/构建阶段并添加了一个新的复制文件阶段。

  5. Made destination "Frameworks", TICKED "Copy only when installing" before adding the framework ( this part is in bold because it is the only thing that I changed from my original attempt ) added the framework to the copy files phase.在添加框架之前制作目标“框架”,勾选“仅在安装时复制” (这部分以粗体显示,因为这是我从原始尝试中更改的唯一内容)将框架添加到复制文件阶段。

My blood pressure is back to normal now..我的血压现在恢复正常了..

This Worked for me:这对我有用:

  • Go to the info.plist file on your Finder.转到 Finder 上的 info.plist 文件。
  • Drag it and Add it to the Project Folder (Without Copying)拖动它并将其添加到项目文件夹(不复制)
  • Delete the Previous Reference (only the Reference, do not move to Trash)删除上一个参考(仅参考,不要移至废纸篓)
  • Try Running it again尝试再次运行

Hope this helps someone :)希望这对某人有所帮助:)

None of above-mentioned or other solutions did work for me.上述或其他解决方案都没有对我有用。 I found a solution after a couple of days searching.经过几天的搜索,我找到了解决方案。

ionic cordova platform remove ios
ionic cordova platform add ios

The reason I removed and added platform was I accidentally deleted some files under the ios folder.我删除和添加平台的原因是我不小心删除了ios文件夹下的一些文件。 So, it brought the necessary files.所以,它带来了必要的文件。

Also you can check the target dependencies.您也可以检查目标依赖项。 It took me 1hr before realising that I have copied a UI test target for target A, but there was a dependency left.我花了 1 小时才意识到我已经为目标 A 复制了一个 UI 测试目标,但仍然存在依赖关系。 So the build required a file that was not mapped to target B, but only to A.因此构建需要一个未映射到目标 B 而仅映射到 A 的文件。

ui test for target B: dependency for target B and A目标 B 的 ui 测试:目标 B和 A 的依赖关系

First you need to check in your project folder whether info.plist is there or not.首先,您需要检查您的项目文件夹中是否存在 info.plist。 If not then you need to copy info.plist from any other application into your project folder and add file in xcode.如果没有,那么您需要将 info.plist 从任何其他应用程序复制到您的项目文件夹中,并在 xcode 中添加文件。 It will solve your problem.它会解决你的问题。

需要考虑的另一件事是在实用程序栏中取消选中 info.plist 的本地化,如果您已选中它然后清除项目,则任务完成!

The answers above did not apply to my case.以上答案不适用于我的情况。

This is what I have discovered.这是我发现的。

Some weeks ago I dowloaded to my Downloads folder a github objective c library for my project.几周前,我将我的项目的 github 目标 C 库下载到我的下载文件夹。 I then added that librabry with "Add Files to..." and the library worked just fine.然后我用“将文件添加到...”添加了该库,并且该库运行良好。

I regularly delete old files and folders from my Downloads.我经常从我的下载中删除旧文件和文件夹。 It happens that I deleted the folder that contained the objective-c library!碰巧我删除了包含objective-c 库的文件夹! Therefore, Xcode was complaining that it could not find a "Info.plist" that was in that folder.因此,Xcode 抱怨它找不到该文件夹​​中的“Info.plist”。 I went to the Trash bin, restored the folder and now it's all good!我去了垃圾箱,恢复了文件夹,现在一切都好了!

Next time I add files to my folder I will make sure the files get copied into the project.下次我将文件添加到我的文件夹时,我将确保将文件复制到项目中。

This Apple doc was of great help: https://developer.apple.com/library/ios/qa/qa1649/_index.html这个 Apple 文档很有帮助: https : //developer.apple.com/library/ios/qa/qa1649/_index.html

Good luck祝你好运

Search "info.plist" using ctrl+sht+f in your project.在您的项目中使用 ctrl+sht+f 搜索“info.plist”。

Tap on the results and you will find it as a field under Build Settings.点击结果,您会在构建设置下的一个字段中找到它。

Ensure that it contains the correct path to your info.plist file as in the project hierarchy.确保它包含您的 info.plist 文件的正确路径,就像在项目层次结构中一样。

在创建具有启用测试用例的框架时,请确保项目应该有两个 info.plist,一个在主项目中,另一个在测试中。现在您收到此错误,因为项目或测试中可能缺少 info.plist 文件.

do this only after reading all the other answers on this page只有在阅读此页面上的所有其他答案后才能执行此操作

So basically the other answers are probably what you need.所以基本上其他答案可能就是你所需要的。 I've tried all of them and they didn't work.我已经尝试了所有这些,但它们都不起作用。 Not because they are wrong, but because I was simply looking at the wrong place.不是因为他们错了,而是因为我只是看错了地方。

Basically the error message simply states: The file "Info.plist" couldn't be opened etc etc. And I noticed all the answers on this page spoke about the plist file pertaining to the actual project (or it's test files, anyway).基本上错误消息只是指出:文件“Info.plist”无法打开等等。我注意到这个页面上的所有答案都谈到了与实际项目有关的 plist 文件(或者它是测试文件,无论如何)。 I double checked 1000 times and they were definitely in the right place.我仔细检查了 1000 次,他们绝对是在正确的地方。

That's when I realized the error message simply wasn't giving enough information, I have many info.plist files on my project!那时我意识到错误消息没有提供足够的信息,我的项目中有很多 info.plist 文件!

So I simply compiled the code outside of xcode using command line like so:所以我只是使用命令行在 xcode之外编译代码,如下所示:

xcodebuild -project project.xcodeproj -alltargets -configuration Debug

It gave me a much more detailed error message:它给了我更详细的错误消息:

... ...

builtin-copyPlist --convert binary1 --outdir /Users/Shared/dev/ios/customer-ios/build/Debug-iphoneos/theApp.app -- theApp/Libs/STPopup/Info.plist /Users/Shared/dev/ios/customer-ios/theApp/Libs/STPopup/Info.plist:0: error: reading data: The file “Info.plist” couldn't be opened because there is no such file. builtin-copyPlist --convert binary1 --outdir /Users/Shared/dev/ios/customer-ios/build/Debug-iphoneos/theApp.app -- theApp/Libs/STPopup/Info.plist /Users/Shared/dev/ ios/customer-ios/theApp/Libs/STPopup/Info.plist:0: error: reading data: 文件“Info.plist”无法打开,因为没有这样的文件。

** BUILD FAILED ** ** 构建失败 **

The following build commands failed: CopyPlistFile build/Debug-iphoneos/theApp.app/Info.plist theApp/Libs/STPopup/Info.plist以下构建命令失败:CopyPlistFile build/Debug-iphoneos/theApp.app/Info.plist theApp/Libs/STPopup/Info.plist

在此处输入图片说明

so it told me which plist file was problematic: Libs/STPopup/Info.plist .. I searched for that file and indeed it turns out I was given a project that had missing libs:所以它告诉我哪个plist 文件有问题: Libs/STPopup/Info.plist ..我搜索了那个文件,结果我得到了一个缺少库的项目:

在此处输入图片说明

Possible XCode 9 Update - I ran into this problem after I moved a bunch of files, including Info.plist, into a "Supporting Files" group.可能的 XCode 9 更新 - 在将包括 Info.plist 在内的一堆文件移动到“支持文件”组后,我遇到了这个问题。 I've never had this error occur before XCode 9, so either it's something I did differently when moving/adding files to a group or it's something new w/ XCode 9 update.我在 XCode 9 之前从未发生过这个错误,所以要么是我在将文件移动/添加到组时做了不同的事情,要么是 XCode 9 更新的新内容。

When creating a group/folder based on selected files in XCode 9, it actually moves the files into a new folder in the Finder.在 XCode 9 中基于所选文件创建组/文件夹时,它实际上将文件移动到 Finder 中的新文件夹中。 Thus, my Info.plist file was moved and XCode/build/compile couldn't find it.因此,我的 Info.plist 文件被移动了,XCode/build/compile 找不到它。 I followed nivritgupta's idea above and it worked perfectly (select "Choose Info.plist File..." from Identity category in General build settings).我遵循了上面 nivritgupta 的想法,并且效果很好(从“常规构建设置”中的“身份”类别中选择“选择 Info.plist 文件...”)。 I then selected the Info.plist file from its new location (that had been) "relocated" by XCode 9, and then my project built without an issue.然后我从它的新位置(已被 XCode 9“重新定位”)选择了 Info.plist 文件,然后我的项目没有出现问题。

Side note: this also fixed the weird "Missing default-568h@2x" warning I started receiving at that same time.旁注:这也修复了我同时开始收到的奇怪的“缺少默认值 568h@2x”警告。 Two birds...两只鸟...

Not for info.plist but for another plist file I encountered the same problem.不是 info.plist 而是另一个 plist 文件,我遇到了同样的问题。 the reason for the error is I inadvertently copied the file to a folder, so it created a symlink.错误的原因是我无意中将文件复制到了一个文件夹,所以它创建了一个符号链接。 and When I remove the original file, this error is thrown.当我删除原始文件时,会抛出此错误。 Deleting the symlinking file resolved the problem.删除符号链接文件解决了问题。

Real Project Example with screenshots showing another way to solve this issue.带有屏幕截图的真实项目示例显示了解决此问题的另一种方法。

Using Swift 4 and Xcode 9.使用 Swift 4 和 Xcode 9。

1-look at the Xcode build error problem as shown in the picture in the ' Step 1 Visual Description ' and it will tell you which Sub Folder in your Xcode Project the file belongs in. In my case it is the NVActivityIndicatorViewExample/Info.plist. 1-查看 Xcode 构建错误问题,如“步骤 1 视觉描述”中的图片所示,它会告诉您文件所属的 Xcode 项目中的哪个子文件夹。在我的情况下,它是 NVActivityIndi​​catorViewExample/Info.plist . Step 1 Visual Description步骤 1 视觉描述

2-But you can also see where the Info.plist file is supposed to be by going to the 'Build Settings' section in your Xcode projects 'Target' area as shown in the picture in the ' Step 2 Visual Description '. 2-但您也可以通过转到 Xcode 项目“目标”区域中的“构建设置”部分来查看 Info.plist 文件的位置,如“步骤 2 视觉描述”中的图片所示。 When you're there look in the 'Packaging section' and click on the 'Info.plist file' row to have a pop up view show you which folder the file is supposed to be in. Step 2 Visual Description当您在那里查看“打包部分”并单击“Info.plist 文件”行以弹出视图显示文件应该在哪个文件夹中。步骤 2 视觉描述

3-Find your Info.plist file, open it up as a source code file by right clicking on it. 3-找到您的 Info.plist 文件,通过右键单击将其作为源代码文件打开。 Look at the Step 3 Visual Description for help.查看第 3 步视觉描述以获取帮助。

4-Copy the code and delete the Info.plist file. 4-复制代码并删除Info.plist文件。 Look at the Step 4 Visual Description for help.查看第 4 步视觉描述以获取帮助。

5-The find the folder inside your project where the Info.plist file is supposed to go according to your build setting then right click on that folder and click on 'New File'. 5-根据您的构建设置,在您的项目中找到 Info.plist 文件所在的文件夹,然后右键单击该文件夹并单击“新建文件”。 Look at the Step 5 Visual Description for help.查看第 5 步视觉描述以获取帮助。

6-Make sure you're in the section for the kind of App (iOS in this case) you're building, go to resources and select 'Property List'. 6-确保您位于您正在构建的应用程序类型(在本例中为 iOS)的部分,转到资源并选择“属性列表”。 Look at the Step 6 Visual Description for help.查看第 6 步视觉描述以获取帮助。

7-Type in "Info" as the file name with no extension, make sure the Group and Target are selected for your application and click "Create". 7-输入“信息”作为文件名,没有扩展名,确保为您的应用程序选择了组和目标,然后单击“创建”。 Look at the Step 7 Visual Description for help.查看步骤 7 视觉描述以获取帮助。

8-Open the newly created Info.plist file as "Source Code", paste the previous XML code you copied from the deleted Info.plist file, save, and the run your app. 8-打开新创建的 Info.plist 文件作为“源代码”,粘贴您从删除的 Info.plist 文件中复制的先前 XML 代码,保存并运行您的应用程序。 (You can also build and clean the project if you want.) (如果需要,您也可以构建和清理项目。)

This is what works for me:这对我有用:

  • close xcode关闭xcode
  • delete dervivedData folder content删除dervivedData文件夹内容
  • open xcode打开xcode
  • product clean产品清洁
  • run again再次运行

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

相关问题 错误:文件“Info.plist”无法打开,因为没有这样的文件 - Error: The file “Info.plist” couldn’t be opened because there is no such file 无法打开“ Info.plist”,因为没有这样的文件 - “Info.plist” could not be opened because there is no such file 升级到Xcode 6 Beta 7,现在得到:无法打开文件info.plist,因为没有这样的文件 - Upgraded to Xcode 6 Beta 7 and now getting: the file info.plist couldn't be opened because there is no such file 读取数据:文件“Info.plist”无法打开,因为没有该文件 - Reading data: The file “Info.plist” couldn't be opened because there is no such file Xamarin iOS,无法打开Info.plist - Xamarin iOS, Info.plist couldn't be opened Info.plist文件“没有这样的文件”错误 - Info.plist file “no such file” error 选择info.plist文件 - choose info.plist file 链接故事板引用时出现ibtool错误:文件“Info.plist”无法保存在文件夹* .storyboardc中 - ibtool error when linking storyboard references: The file “Info.plist” couldn't be saved in the folder *.storyboardc 错误:无法从文件中读取属性列表:/Info.plist:操作无法完成 - error: unable to read property list from file: /Info.plist: The operation couldn’t be completed info.plist错误? - Wrong info.plist?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM