ios 我在 xCode5-iOS7 中收到错误“所有输入目录都不包含匹配的启动图像”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19511342/
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
I get an error "None of the input catalogs contained a matching launch image" in xCode5-iOS7
提问by Amit.TS
I'm trying to define launch images. Probably only one image is missing.
我正在尝试定义启动图像。可能只有一张图片丢失了。
I'm following the instructions from this site Create launch images in different sizes for different devices
我正在按照此站点的说明为不同设备创建不同大小的启动图像
So I have 7 images with the required size. But when I drag them to LaonchImages sheet it requires 8 images...the one that is missing is called "iPhone Portrait 2x" and according to the details pane I found its size 640x960 and I added it.
所以我有 7 张所需大小的图像。但是,当我将它们拖到 LaonchImages 工作表时,它需要 8 张图像……缺少的图像称为“iPhone Portrait 2x”,根据详细信息窗格,我找到了它的大小 640x960 并添加了它。
sill I'm getting the error - and the compilation fails...
我收到错误 - 编译失败......
回答by Desmond
Select your project, go to Build Settings, search for AppIcon-2 and change it into AppIcon and you will be fine.
选择您的项目,转到 Build Settings,搜索 AppIcon-2 并将其更改为 AppIcon 就可以了。
回答by user3540599
Select project file and then select target in question. In General tab there is in app icons and launch images launch image source should be "Use assets category"
选择项目文件,然后选择有问题的目标。在常规选项卡中有应用程序图标和启动图像启动图像源应该是“使用资产类别”
回答by galactikuh
My LaunchImage file had been deleted and I had to add a new one in my xcassets.
我的 LaunchImage 文件已被删除,我不得不在我的 xcassets 中添加一个新文件。
Go to your images.xcassets. If there is no LaunchImage listed on the left, click the plus button at the bottom and navigate to new iOS launch image.
转到您的 images.xcassets。如果左侧未列出 LaunchImage,请单击底部的加号按钮并导航到新的 iOS 启动图像。
回答by Lukas Kalinski
In my case the problem was solved by removing the reference to Images.xcassets and then add it to the project again.
在我的情况下,通过删除对 Images.xcassets 的引用,然后再次将其添加到项目中,解决了问题。
I'm not sure what caused the problem, but it may have something to do with the fact that I moved the assets "file" from one Xcode group to another, which would be weird as the file's path remained the same, but that was also the only thing I did with the file...
我不确定是什么导致了问题,但这可能与我将资产“文件”从一个 Xcode 组移动到另一个这一事实有关,这很奇怪,因为文件的路径保持不变,但那是也是我对文件所做的唯一一件事......
回答by Rem-D
We had our Asset Catalog Launch Image Set Nameset in our project target. After removing this from the targetand instead setting it in our projectit compiled fine.
我们在项目目标中设置了资产目录启动图像集名称。从目标中删除它并在我们的项目中设置它后,它编译得很好。
回答by itsViksIn
For me the problem occurred when i have added a new watch target. Even though i had AppIcon set i was getting the error, i fixed it by removing the reference of asset catalog and added it back, you can do it by deleting the reference and add it back.
对我来说,当我添加了一个新的监视目标时出现了问题。即使我设置了 AppIcon,我也遇到了错误,我通过删除资产目录的引用并将其添加回来来修复它,您可以通过删除引用并将其添加回来来实现。
回答by Borzh
I could solve this by going to Build Settingsof my target, searching for word "launch", then removing (using Backspace) "Asset Catalog Launch Image Set Name", that was set to LaunchImage.
我可以通过转到目标的构建设置来解决这个问题,搜索单词“launch”,然后删除(使用退格键)“Asset Catalog Launch Image Set Name”(设置为 LaunchImage)。
回答by Pradeep Reddy Kypa
This generally happens when you have accidentally deleted Assets.xcassets. You need to follow the below steps.
这通常发生在您不小心删除了Assets.xcassets 时。您需要按照以下步骤操作。
- Right click on Assets.xcassetsand select Show File Inspector.
- Check if the desired target has been checked under Target Membership.
- If its unchecked, Please select the target for which you need the Assets to be used.
- Clean and Build the App.
- 右键单击Assets.xcassets并选择Show File Inspector。
- 检查所需的目标是否已在Target Membership下选中 。
- 如果未选中,请选择您需要使用资产的目标。
- 清理并构建应用程序。