xcode 文件夹“Images.xcassets”不存在
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26584572/
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
The folder "Images.xcassets" doesn't exist
提问by Maximus S
When I open the project file in the latest xcode version, I get the error "The folder "Images.xcassets" doesn't exist" in two popups. I have to click OK multiple times to make the popups disappear. I haven't done anything to remove such folders. Does anyone have an idea why I might be getting them?
当我在最新的 xcode 版本中打开项目文件时,我在两个弹出窗口中收到错误“文件夹“Images.xcassets”不存在”。我必须多次单击确定才能使弹出窗口消失。我没有做任何事情来删除这些文件夹。有谁知道为什么我可能会得到它们?
Update:
更新:
I see it in finder and in my project explorer too. The problem still persists.
我在 finder 和我的项目浏览器中也看到了它。问题仍然存在。
采纳答案by JThora
You have probably set your launch images to be extracted from an asset catalog (which is 'images.xcassets' by default). If you don't want to use asset catalogs, go to your application settings and select 'don't use asset catalogs', but, if you do (I recommend you do use asset catalogs for App Icons and Launch Images), click 'create asset catalog'. If that option isn't available, right click on your project, select 'New File', go to 'Resource', and select Asset Catalog.
您可能已将启动图像设置为从资产目录中提取(默认为“images.xcassets”)。如果您不想使用资产目录,请转到您的应用程序设置并选择“不使用资产目录”,但是,如果您这样做(我建议您为应用程序图标和启动图像使用资产目录),请单击“创建资产目录”。如果该选项不可用,请右键单击您的项目,选择“新建文件”,转到“资源”,然后选择资产目录。
回答by JThora
I used the hotkey combinations for Cleaning the Project and Cleaning the Build Folder. Building again after this did the trick. The problem came up after merging too Git Repository Branches of our Project and trying to build.
我使用热键组合来清理项目和清理构建文件夹。在此之后再次构建成功了。在合并了我们项目的 Git 存储库分支并尝试构建之后,问题出现了。
Clean Build Folder:
清理构建文件夹:
Option+ Shift+ Command+ K
Option+ Shift+ Command+ K
Clean Project:
清洁项目:
Shift+ Command+ K
Shift+ Command+ K
回答by Mark Pospesel
I have been plagued by this problem over the past month or two. It didn't hurt anything – it was just annoying. The problem exhibited itself in both Xcode's 6.4 and 7.
在过去的一两个月里,我一直被这个问题所困扰。它没有伤害任何东西——只是很烦人。这个问题在 Xcode 的 6.4 和 7 中都出现了。
I finally fixed it today by inserting the following lines into our project's info.plist:
我今天终于通过将以下几行插入我们项目的 info.plist 来修复它:
<key>CFBundleIcons</key>
<dict/>
<key>CFBundleIcons~ipad</key>
<dict/>
Actually what I did was from the project settings' General pane under App Icons and Launch Images, I changed the App Icons Source from my asset catalog to "Don't use asset catalogs" and then changed it back to "Use Asset Catalog". Xcode then modified my asset catalog by inserting a 2nd entry for AppIcon, but I just rolled that change back using my git client. The change to the info.plist (shown above) I left in place, and this solved the issue for me.
实际上我所做的是从应用程序图标和启动图像下的项目设置的常规窗格中,我将应用程序图标源从我的资产目录更改为“不使用资产目录”,然后将其改回“使用资产目录”。然后 Xcode 通过为 AppIcon 插入第二个条目来修改我的资产目录,但我只是使用我的 git 客户端回滚了该更改。对 info.plist 的更改(如上所示)我留在原地,这为我解决了这个问题。
回答by Lucas Popenke
I solved a similar issue by doing this:
我通过这样做解决了类似的问题:
- Remove the
Images.xcassets
folder from your project. - Close Xcode and open
.xcodeproj
using VSCode or similar tool.
Images.xcassets
从您的项目中删除该文件夹。- 关闭 Xcode 并
.xcodeproj
使用 VSCode 或类似工具打开。
In VSCode, find every reference to Images.xcassets
and remove the line. Save the file and open Xcode. Then add Images.xcassets
back to your project.
在 VSCode 中,找到每个引用Images.xcassets
并删除该行。保存文件并打开 Xcode。然后添加Images.xcassets
回您的项目。
回答by S_Criminal
Set the 'App icons source' and 'Launch Images Source' to 'Don't use asset catalogs', switch to other file then switch back, the popups will disappear.
Reset the 'App icons source' and 'Launch Images Source'.
将“应用程序图标源”和“启动图像源”设置为“不使用资产目录”,切换到其他文件然后切换回来,弹出窗口将消失。
重置“应用程序图标源”和“启动图像源”。
回答by bharathi kumar
Exact situation happened for me. The thing is that , i have added second target unknowingly. Deleting all the files related to that second target , solved the issue.
确切的情况发生在我身上。问题是,我在不知不觉中添加了第二个目标。删除与第二个目标相关的所有文件,解决了问题。
回答by user7393608
Add Image. Imageset folder in your project, in Assets.xcassets director.
添加图片。项目中的 Imageset 文件夹,在 Assets.xcassets 目录中。