I'm running into what seems to be common error, in that Xcode can't seem to find my 'Info.plist' file.
我遇到了一个常见的错误,在Xcode中似乎找不到我的信息。plist文件。
I've checked the answers to these two * 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. The type and location are correct as shown in the image below:
我检查了这两个*问题的答案(无法从Info中读取)。plist和目标C/Xcode错误:文件“信息”。无法打开plist“因为没有这样的文件)…我正在使用一个相对路径,plist文件位于正确的绝对位置。类型和位置正确,如下图所示:
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 still can't find 'info.plist'.
我还试过重新安装XCODE并替换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)。
22 个解决方案
#1
95
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中也遇到了类似的问题,但是上面的解决方案对我都不起作用,最后我有机会解决这个问题
- Go to: App Target
- 至:应用目标
- See the Identify and choose the Plist
- 查看标识并选择Plist
See the screenshot also
看到截图也
Enjoy
享受
#2
48
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无法打开,因为没有这样的文件,“我已经删除了“项目测试”文件夹中的所有文件,但是仍然有在我的目标下列出的“项目测试”。删除“测试”目标后,项目成功构建。
#3
20
I faced similar kind of situation when I updated my XCode to 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." Therefore, I looked up to the targets of my application which were: "App" & "AppTests". I checked for the 'Packaging' field in 'Build Settings' tab.
当我将XCode更新为6.1时,我遇到了类似的情况。我的项目包含的信息。但是我得到了这个错误:“文件”信息。因为没有这样的文件,所以无法打开plist。因此,我查找了我的应用程序的目标:“App”和“AppTests”。我在“构建设置”选项卡中检查了“打包”字段。
Target: 'App' -> 'Build Settings' -> 'Packaging' -> 'Info.plist file(field)' - the location should be correct
目标:'App' -> 'Build Settings' -> '打包' -> 'Info。plist文件(字段)' -位置应该是正确的
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文件(字段)——位置必须是这样的:“AppTests/Info.plist”。保持这个字段是空的。删除的位置。
It seems that Apple is checking this location by default for finding Info.plist. Clean & Build your project. It will work. Worked for me.
看起来苹果默认是在检查这个位置以查找Info.plist。清理并构建您的项目。它将工作。为我工作。
#4
8
For me, the anwser for this issue was:
对我来说,这个问题的答案是:
1.Turn off Xcode
1。关掉Xcode
2.Go to ./Users/You/Library/Developer/Xcode/DerivedData
2。去。/用户/你/图书馆/开发/ 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(6 e35b)
#5
4
go to targets. right click on the test target. yourProjectTests and delete it
去的目标。右键单击测试目标。yourProjectTests和删除它
#6
2
As answered by @narner (answer marked as correct), yes it can make code work. But here is something better to solve the problem.
正如@narner所回答的(答案标记为正确),是的,它可以使代码工作。但这里有更好的方法来解决这个问题。
My suggestion is that instead of delete tests targets, better if we change the path of info.plist under tests target.
我的建议是,与其删除测试目标,不如改变信息路径。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.
在项目中,点击项目文件——目标下的>项目名称测试——>构建设置——>打包——>信息。你在这里改变文件的路径。
#7
2
In my case i was edited my xcode project folder name so that this is happened after changing folder's new name(Project -> Targets -> Build settings -> Packaging -> Info.plist name) then working fine.
在我的例子中,我被编辑了我的xcode项目文件夹名,所以这是在更改文件夹的新名称之后发生的(项目->目标->构建设置->打包->信息。plist名称)然后工作良好。
#8
1
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. At the end I restarted my computer with the only hope to resolve this issue which surprisingly worked for me!!!
这是我面临的最奇怪的问题之一。在我的例子中,我没有丢失任何文件,我清除了派生数据,清除了模块缓存,多次清理了项目,重新启动了xcode,但是没有任何东西对我有用。最后,我重新启动了我的电脑,唯一的希望就是解决这个问题,这个问题出乎我的意料!!!
#9
1
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. 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:
对我来说,问题是我添加了一个框架。我知道,因为当添加的时候,我遇到了问题,我在模拟器上不断测试,我打开模拟器日志找到了信息。plist问题只与我添加的框架有关。为了再次检查,我删除了框架和所有对它的引用,并尝试再次构建模拟器,一切恢复正常。所以,当我尝试了我在这里和其他地方读到的所有东西,但都没能解决问题之后,我就想认输,但在我最后一次尝试时,我做了如下的尝试,24小时后,我成功了:
-
I removed references and completely deleted the framework in question from my Xcode project.
我删除了引用,并完全删除了Xcode项目中的框架。
-
Opened Simulator, chose Simulator/Reset Content and Settings..
打开模拟器,选择模拟器/复位内容和设置
-
In Xcode, I did a Product/Clean and while holding alt down, did a Product/Clean Build Folder. I think if you do the latter of the 2, Product/Clean is unnecessary, but I was grabbing at straws
在Xcode中,我做了一个Product/Clean,按住alt键,做了一个Product/Clean Build文件夹。我认为如果你做后一个,产品/清洁是不必要的,但我抓住了稻草
-
To add the framework back to the project, I chose the target/Build Phases and added a new Copy Files phase.
为了将框架添加回项目,我选择了目标/构建阶段,并添加了一个新的复制文件阶段。
-
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..
我的血压现在已经恢复正常了。
#10
1
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. the search paths seem to have gotten confused and needed to be explicitly told where the files were located.
在过去的几个小时里,我也遇到了这个问题。我从早期版本下载了github项目。搜索路径似乎有点混乱,需要明确地告诉文件的位置。
#11
1
Possible XCode 9 Update - I ran into this problem after I moved a bunch of files, including Info.plist, into a "Supporting Files" group. 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更新——我在移动了很多文件之后遇到了这个问题,包括Info。plist,进入一个“支持文件”组。在XCode 9之前,我从来没有遇到过这种错误,所以在向组移动/添加文件时,我做了不同的事情,或者是新的w/ 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. Thus, my Info.plist file was moved and XCode/build/compile couldn't find it. I followed nivritgupta's idea above and it worked perfectly (select "Choose Info.plist File..." from Identity category in General build settings). 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中的选定文件创建组/文件夹时,它实际上会将文件移动到Finder中的新文件夹中。因此,我的信息。plist文件被移动,XCode/build/compile没有找到它。我遵循了nivritgupta的想法,它非常有效(选择“选择信息”)。plist文件…“来自一般构建设置中的标识类别)。然后我选择了信息。plist文件来自它的新位置“重新定位”XCode 9,然后我的项目没有问题。
Side note: this also fixed the weird "Missing default-568h@2x" warning I started receiving at that same time. Two birds...
附加说明:这也修正了我同时开始收到的奇怪的“丢失的default-568h@2x”警告。两只鸟……
#12
0
First you need to check in your project folder whether info.plist is there or not. If not then you need to copy info.plist from any other application into your project folder and add file in xcode. It will solve your problem.
首先你需要检查你的项目文件夹是否有信息。plist是否存在。如果没有,你需要复制信息。将任何其他应用程序的plist添加到项目文件夹中,并在xcode中添加文件。它会解决你的问题。
#13
0
One other thing for consideration is to uncheck Localization for info.plist in utility bar,if you have checked it and then clear the project,the task is done!
另一件需要考虑的事情是取消对info的本地化检查。在实用工具栏中的plist,如果您已经检查并清除了项目,任务就完成了!
#14
0
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. I then added that librabry with "Add Files to..." and the library worked just fine.
几个星期前,我下载了一个github objective - c库,用于我的项目。然后我又加上了“向……添加文件”的librabry,这个图书馆运行得很好。
I regularly delete old files and folders from my Downloads. It happens that I deleted the folder that contained the objective-c library! Therefore, Xcode was complaining that it could not find a "Info.plist" that was in that folder. I went to the Trash bin, restored the folder and now it's all good!
我经常从下载中删除旧的文件和文件夹。碰巧我删除了包含objective-c库的文件夹!因此,Xcode抱怨说找不到“信息”。在那个文件夹里的plist。我去垃圾箱,恢复文件夹,现在一切都好了!
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
这个苹果文档非常有用:https://developer.apple.com/library/ios/qa/qa1649/_index.html
Good luck
祝你好运
#15
0
Search "info.plist" using ctrl+sht+f in your project.
搜索”信息。在你的项目中使用ctrl+sht+f。
Tap on the results and you will find it as a field under Build Settings.
点击结果,您会发现它是一个在Build Settings下的字段。
Ensure that it contains the correct path to your info.plist file as in the project hierarchy.
确保它包含到您的信息的正确路径。项目层次结构中的plist文件。
#16
0
While creating framework with enabled test cases, please ensure project should have two info.plist, one in the main project and other in tests.now you are getting this error because there may be missing of info.plist file either in project or in tests.
在使用已启用的测试用例创建框架时,请确保项目应该包含两个信息。plist,一个在主项目中,另一个在测试中。现在你得到了这个错误,因为可能缺少信息。plist文件要么在项目中,要么在测试中。
#17
0
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). I double checked 1000 times and they were definitely in the right place.
基本上,错误信息只是声明:文件“信息”。plist“不能被打开等等。我注意到这个页面上所有的答案都是关于plist文件的,它与实际的项目相关(或者是测试文件)。我重复检查了1000次,结果肯定是对的。
That's when I realized the error message simply wasn't giving enough information, I have many info.plist files on my project!
当我意识到错误信息并没有提供足够的信息时,我有很多信息。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.
build - copyplist——转换binary1—outdir /用户/共享/dev/ios/用户-ios/创建/调试-iphoneos/应用程序。应用程序——theApp / Libs / STPopup /信息。plist /用户/共享/ dev / ios / customer-ios / theApp / Libs / STPopup /信息。错误:读取数据:文件“信息”。因为没有这样的文件,所以无法打开plist。
** BUILD FAILED **
* *构建失败的* *
The following build commands failed: CopyPlistFile build/Debug-iphoneos/theApp.app/Info.plist theApp/Libs/STPopup/Info.plist
以下构建命令失败:CopyPlistFile构建/调试-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。我搜索了那个文件,结果发现我得到了一个缺少libs的项目:
#18
0
This Worked for me:
这工作对我来说:
- Go to the info.plist file on your Finder.
- 去信息。查找器上的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 :)
希望这能帮助某人:
#19
0
Not for info.plist but for another plist file I encountered the same problem. 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.
没有信息。但是对于另一个plist文件,我遇到了同样的问题。错误的原因是我不小心将文件复制到一个文件夹中,所以它创建了一个符号链接。当我删除原始文件时,这个错误被抛出。删除符号链接文件解决了这个问题。
#20
0
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. Step 1 Visual Description
1看看Xcode构建错误问题,如“步骤1可视化描述”中的图片所示,它将告诉您该文件所属的Xcode项目中的哪个子文件夹。在我的例子中,它是NVActivityIndicatorViewExample/Info.plist。步骤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'. 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
2-但是你也可以看到信息在哪里。plist文件应该是通过进入Xcode项目“目标”区域的“构建设置”部分,如“第二步视觉描述”中的图片所示。当你在那里的时候,看看“包装”部分,然后点击“信息”。plist文件的行有一个弹出视图,显示文件应该在哪个文件夹中。步骤2视觉描述
3-Find your Info.plist file, open it up as a source code file by right clicking on it. Look at the Step 3 Visual Description for help.
3-Find你的信息。plist文件,通过右键点击它打开源代码文件。查看步骤3的可视化描述以获得帮助。
4-Copy the code and delete the Info.plist file. Look at the Step 4 Visual Description for help.
复制代码并删除信息。plist文件。查看第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'. Look at the Step 5 Visual Description for help.
5 .在你的项目中找到信息所在的文件夹。plist文件应该根据您的构建设置执行,然后右键单击该文件夹并单击“New file”。请看第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'. Look at the Step 6 Visual Description for help.
6-确保你在你正在构建的应用程序(本例中为iOS)的部分,进入参考资料并选择“Property List”。查看第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". Look at the Step 7 Visual Description for help.
7输入“Info”作为无扩展名的文件名,确保为您的应用程序选择了组和目标,并单击“Create”。查看第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. (You can also build and clean the project if you want.)
8打开新创建的信息。plist文件作为“源代码”,粘贴从删除的信息中复制的以前的XML代码。plist文件、save和运行您的应用程序(如果您愿意,也可以构建和清理项目)。
#21
0
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. So, it brought the necessary files.
我删除和添加平台的原因是我不小心删除了ios文件夹下的一些文件。所以,它带来了必要的文件。
#22
0
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. So the build required a file that was not mapped to target B, but only to A.
您还可以检查目标依赖项。我花了1小时才意识到我已经为目标a复制了一个UI测试目标,但是还剩下一个依赖项。因此构建需要一个没有映射到目标B,而只映射到a的文件。
ui test for target B: dependency for target B and A
目标B的ui测试:目标B和A的依赖关系
#1
95
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中也遇到了类似的问题,但是上面的解决方案对我都不起作用,最后我有机会解决这个问题
- Go to: App Target
- 至:应用目标
- See the Identify and choose the Plist
- 查看标识并选择Plist
See the screenshot also
看到截图也
Enjoy
享受
#2
48
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无法打开,因为没有这样的文件,“我已经删除了“项目测试”文件夹中的所有文件,但是仍然有在我的目标下列出的“项目测试”。删除“测试”目标后,项目成功构建。
#3
20
I faced similar kind of situation when I updated my XCode to 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." Therefore, I looked up to the targets of my application which were: "App" & "AppTests". I checked for the 'Packaging' field in 'Build Settings' tab.
当我将XCode更新为6.1时,我遇到了类似的情况。我的项目包含的信息。但是我得到了这个错误:“文件”信息。因为没有这样的文件,所以无法打开plist。因此,我查找了我的应用程序的目标:“App”和“AppTests”。我在“构建设置”选项卡中检查了“打包”字段。
Target: 'App' -> 'Build Settings' -> 'Packaging' -> 'Info.plist file(field)' - the location should be correct
目标:'App' -> 'Build Settings' -> '打包' -> 'Info。plist文件(字段)' -位置应该是正确的
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文件(字段)——位置必须是这样的:“AppTests/Info.plist”。保持这个字段是空的。删除的位置。
It seems that Apple is checking this location by default for finding Info.plist. Clean & Build your project. It will work. Worked for me.
看起来苹果默认是在检查这个位置以查找Info.plist。清理并构建您的项目。它将工作。为我工作。
#4
8
For me, the anwser for this issue was:
对我来说,这个问题的答案是:
1.Turn off Xcode
1。关掉Xcode
2.Go to ./Users/You/Library/Developer/Xcode/DerivedData
2。去。/用户/你/图书馆/开发/ 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(6 e35b)
#5
4
go to targets. right click on the test target. yourProjectTests and delete it
去的目标。右键单击测试目标。yourProjectTests和删除它
#6
2
As answered by @narner (answer marked as correct), yes it can make code work. But here is something better to solve the problem.
正如@narner所回答的(答案标记为正确),是的,它可以使代码工作。但这里有更好的方法来解决这个问题。
My suggestion is that instead of delete tests targets, better if we change the path of info.plist under tests target.
我的建议是,与其删除测试目标,不如改变信息路径。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.
在项目中,点击项目文件——目标下的>项目名称测试——>构建设置——>打包——>信息。你在这里改变文件的路径。
#7
2
In my case i was edited my xcode project folder name so that this is happened after changing folder's new name(Project -> Targets -> Build settings -> Packaging -> Info.plist name) then working fine.
在我的例子中,我被编辑了我的xcode项目文件夹名,所以这是在更改文件夹的新名称之后发生的(项目->目标->构建设置->打包->信息。plist名称)然后工作良好。
#8
1
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. At the end I restarted my computer with the only hope to resolve this issue which surprisingly worked for me!!!
这是我面临的最奇怪的问题之一。在我的例子中,我没有丢失任何文件,我清除了派生数据,清除了模块缓存,多次清理了项目,重新启动了xcode,但是没有任何东西对我有用。最后,我重新启动了我的电脑,唯一的希望就是解决这个问题,这个问题出乎我的意料!!!
#9
1
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. 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:
对我来说,问题是我添加了一个框架。我知道,因为当添加的时候,我遇到了问题,我在模拟器上不断测试,我打开模拟器日志找到了信息。plist问题只与我添加的框架有关。为了再次检查,我删除了框架和所有对它的引用,并尝试再次构建模拟器,一切恢复正常。所以,当我尝试了我在这里和其他地方读到的所有东西,但都没能解决问题之后,我就想认输,但在我最后一次尝试时,我做了如下的尝试,24小时后,我成功了:
-
I removed references and completely deleted the framework in question from my Xcode project.
我删除了引用,并完全删除了Xcode项目中的框架。
-
Opened Simulator, chose Simulator/Reset Content and Settings..
打开模拟器,选择模拟器/复位内容和设置
-
In Xcode, I did a Product/Clean and while holding alt down, did a Product/Clean Build Folder. I think if you do the latter of the 2, Product/Clean is unnecessary, but I was grabbing at straws
在Xcode中,我做了一个Product/Clean,按住alt键,做了一个Product/Clean Build文件夹。我认为如果你做后一个,产品/清洁是不必要的,但我抓住了稻草
-
To add the framework back to the project, I chose the target/Build Phases and added a new Copy Files phase.
为了将框架添加回项目,我选择了目标/构建阶段,并添加了一个新的复制文件阶段。
-
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..
我的血压现在已经恢复正常了。
#10
1
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. the search paths seem to have gotten confused and needed to be explicitly told where the files were located.
在过去的几个小时里,我也遇到了这个问题。我从早期版本下载了github项目。搜索路径似乎有点混乱,需要明确地告诉文件的位置。
#11
1
Possible XCode 9 Update - I ran into this problem after I moved a bunch of files, including Info.plist, into a "Supporting Files" group. 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更新——我在移动了很多文件之后遇到了这个问题,包括Info。plist,进入一个“支持文件”组。在XCode 9之前,我从来没有遇到过这种错误,所以在向组移动/添加文件时,我做了不同的事情,或者是新的w/ 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. Thus, my Info.plist file was moved and XCode/build/compile couldn't find it. I followed nivritgupta's idea above and it worked perfectly (select "Choose Info.plist File..." from Identity category in General build settings). 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中的选定文件创建组/文件夹时,它实际上会将文件移动到Finder中的新文件夹中。因此,我的信息。plist文件被移动,XCode/build/compile没有找到它。我遵循了nivritgupta的想法,它非常有效(选择“选择信息”)。plist文件…“来自一般构建设置中的标识类别)。然后我选择了信息。plist文件来自它的新位置“重新定位”XCode 9,然后我的项目没有问题。
Side note: this also fixed the weird "Missing default-568h@2x" warning I started receiving at that same time. Two birds...
附加说明:这也修正了我同时开始收到的奇怪的“丢失的default-568h@2x”警告。两只鸟……
#12
0
First you need to check in your project folder whether info.plist is there or not. If not then you need to copy info.plist from any other application into your project folder and add file in xcode. It will solve your problem.
首先你需要检查你的项目文件夹是否有信息。plist是否存在。如果没有,你需要复制信息。将任何其他应用程序的plist添加到项目文件夹中,并在xcode中添加文件。它会解决你的问题。
#13
0
One other thing for consideration is to uncheck Localization for info.plist in utility bar,if you have checked it and then clear the project,the task is done!
另一件需要考虑的事情是取消对info的本地化检查。在实用工具栏中的plist,如果您已经检查并清除了项目,任务就完成了!
#14
0
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. I then added that librabry with "Add Files to..." and the library worked just fine.
几个星期前,我下载了一个github objective - c库,用于我的项目。然后我又加上了“向……添加文件”的librabry,这个图书馆运行得很好。
I regularly delete old files and folders from my Downloads. It happens that I deleted the folder that contained the objective-c library! Therefore, Xcode was complaining that it could not find a "Info.plist" that was in that folder. I went to the Trash bin, restored the folder and now it's all good!
我经常从下载中删除旧的文件和文件夹。碰巧我删除了包含objective-c库的文件夹!因此,Xcode抱怨说找不到“信息”。在那个文件夹里的plist。我去垃圾箱,恢复文件夹,现在一切都好了!
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
这个苹果文档非常有用:https://developer.apple.com/library/ios/qa/qa1649/_index.html
Good luck
祝你好运
#15
0
Search "info.plist" using ctrl+sht+f in your project.
搜索”信息。在你的项目中使用ctrl+sht+f。
Tap on the results and you will find it as a field under Build Settings.
点击结果,您会发现它是一个在Build Settings下的字段。
Ensure that it contains the correct path to your info.plist file as in the project hierarchy.
确保它包含到您的信息的正确路径。项目层次结构中的plist文件。
#16
0
While creating framework with enabled test cases, please ensure project should have two info.plist, one in the main project and other in tests.now you are getting this error because there may be missing of info.plist file either in project or in tests.
在使用已启用的测试用例创建框架时,请确保项目应该包含两个信息。plist,一个在主项目中,另一个在测试中。现在你得到了这个错误,因为可能缺少信息。plist文件要么在项目中,要么在测试中。
#17
0
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). I double checked 1000 times and they were definitely in the right place.
基本上,错误信息只是声明:文件“信息”。plist“不能被打开等等。我注意到这个页面上所有的答案都是关于plist文件的,它与实际的项目相关(或者是测试文件)。我重复检查了1000次,结果肯定是对的。
That's when I realized the error message simply wasn't giving enough information, I have many info.plist files on my project!
当我意识到错误信息并没有提供足够的信息时,我有很多信息。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.
build - copyplist——转换binary1—outdir /用户/共享/dev/ios/用户-ios/创建/调试-iphoneos/应用程序。应用程序——theApp / Libs / STPopup /信息。plist /用户/共享/ dev / ios / customer-ios / theApp / Libs / STPopup /信息。错误:读取数据:文件“信息”。因为没有这样的文件,所以无法打开plist。
** BUILD FAILED **
* *构建失败的* *
The following build commands failed: CopyPlistFile build/Debug-iphoneos/theApp.app/Info.plist theApp/Libs/STPopup/Info.plist
以下构建命令失败:CopyPlistFile构建/调试-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。我搜索了那个文件,结果发现我得到了一个缺少libs的项目:
#18
0
This Worked for me:
这工作对我来说:
- Go to the info.plist file on your Finder.
- 去信息。查找器上的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 :)
希望这能帮助某人:
#19
0
Not for info.plist but for another plist file I encountered the same problem. 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.
没有信息。但是对于另一个plist文件,我遇到了同样的问题。错误的原因是我不小心将文件复制到一个文件夹中,所以它创建了一个符号链接。当我删除原始文件时,这个错误被抛出。删除符号链接文件解决了这个问题。
#20
0
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. Step 1 Visual Description
1看看Xcode构建错误问题,如“步骤1可视化描述”中的图片所示,它将告诉您该文件所属的Xcode项目中的哪个子文件夹。在我的例子中,它是NVActivityIndicatorViewExample/Info.plist。步骤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'. 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
2-但是你也可以看到信息在哪里。plist文件应该是通过进入Xcode项目“目标”区域的“构建设置”部分,如“第二步视觉描述”中的图片所示。当你在那里的时候,看看“包装”部分,然后点击“信息”。plist文件的行有一个弹出视图,显示文件应该在哪个文件夹中。步骤2视觉描述
3-Find your Info.plist file, open it up as a source code file by right clicking on it. Look at the Step 3 Visual Description for help.
3-Find你的信息。plist文件,通过右键点击它打开源代码文件。查看步骤3的可视化描述以获得帮助。
4-Copy the code and delete the Info.plist file. Look at the Step 4 Visual Description for help.
复制代码并删除信息。plist文件。查看第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'. Look at the Step 5 Visual Description for help.
5 .在你的项目中找到信息所在的文件夹。plist文件应该根据您的构建设置执行,然后右键单击该文件夹并单击“New file”。请看第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'. Look at the Step 6 Visual Description for help.
6-确保你在你正在构建的应用程序(本例中为iOS)的部分,进入参考资料并选择“Property List”。查看第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". Look at the Step 7 Visual Description for help.
7输入“Info”作为无扩展名的文件名,确保为您的应用程序选择了组和目标,并单击“Create”。查看第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. (You can also build and clean the project if you want.)
8打开新创建的信息。plist文件作为“源代码”,粘贴从删除的信息中复制的以前的XML代码。plist文件、save和运行您的应用程序(如果您愿意,也可以构建和清理项目)。
#21
0
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. So, it brought the necessary files.
我删除和添加平台的原因是我不小心删除了ios文件夹下的一些文件。所以,它带来了必要的文件。
#22
0
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. So the build required a file that was not mapped to target B, but only to A.
您还可以检查目标依赖项。我花了1小时才意识到我已经为目标a复制了一个UI测试目标,但是还剩下一个依赖项。因此构建需要一个没有映射到目标B,而只映射到a的文件。
ui test for target B: dependency for target B and A
目标B的ui测试:目标B和A的依赖关系