Xcode 5:“无效的图像路径" CFBundleIcons [英] Xcode 5: "Invalid image path" CFBundleIcons

查看:114
本文介绍了Xcode 5:“无效的图像路径" CFBundleIcons的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,我的问题似乎类似于,和,但是按照答案,没有帮助我.这可能是因为我在使用Xcode 5之前,在升级到此版本之前,这个应用程序没有任何问题.

Ok, my problem seems to be similar to this, and this, but following the answers, there is not helping me. This might be because I am using Xcode 5, before I upgraded to this version I wasn't having any problems with this app.

当我验证我的应用程序时,出现以下错误:

When I validate my app I get the following error:

无效的图像路径-在键下引用的路径上找不到图像 'CFBundleIcons':'icon152'"

"Invalid Image Path - No image found at the path referenced under key 'CFBundleIcons': 'icon152'"

所以我转到Xcode中的.plist文件,右键单击Show Raw Keys/Values并找到CFBundleIcons.

So I go to the .plist file in Xcode, right click Show Raw Keys/Values and find CFBundleIcons.

有一棵看起来像这样的树:

There is a tree that looks like this:

▼ CFBundleIcons                  Dictionary
    ▼ CFBundlePrimaryIcon        Dictionary
        ▼ CFBundleIconFiles      Array
             Item 0              String       icon152

现在,我已将icon152重命名为icon152.png,但仍然无法正常工作.此值是否需要Mac上映像的完整路径?如果可以,为什么从头开始添加图像时为什么没有插入完整路径?我之前已经验证过应用程序,但从未遇到过这些问题.

Now I've renamed icon152 to icon152.png, and it still doesn't work. Does this value require the full path to the image on my mac? And if it does, why am I not getting the full path inserted when I add the image from scratch? I've validated apps before and never experienced these problems.

我尝试从.plist文件中删除所有图标条目,然后重新添加它们,但仍然无法正常工作.

I've tried removing all the icon entries out of the .plist file and re-adding them, still doesn't work.

我尝试将图像从捆绑软件和Xcode中完全删除,然后从头开始完全重新添加它们.仍然不起作用.

I've tried removing the images from the bundle and Xcode altogether, and completely re-added them from scratch. Still doesn't work.

有人可以告诉我我在做什么错吗?

Can anybody tell me what I am doing wrong?

如果其他任何人都在为此苦苦挣扎,我要做的就是解决问题,那就是单击使用资产目录"按钮-所有这些问题都消失了.您可以通过在导航器中单击您的项目来找到该按钮,然后在常规"下向下滚动到应用程序图标"-该按钮应该在那里.

If anybody else is struggling with this, all I did to solve it was click the "Use Asset Catalog" button - and all these problems disappeared. You can find that button by clicking on your project in the Navigator, then under General scroll down to App Icons - the button should be there.

推荐答案

您可以尝试从项目中删除图标,然后再次添加它们吗?然后尝试使用不带.png的名称.

Can you try removing the icon from the project and adding them again? Then try to use the name without .png.

如果您在Finder中修改文件,有时Xcode将看不到更改.

Sometimes Xcode can't see the changes if you modify the file in Finder.

这篇关于Xcode 5:“无效的图像路径" CFBundleIcons的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆