xcode 由于图标问题无法构建我的项目

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10556982/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 00:17:21  来源:igfitidea点击:

Unable to build my project because of Icon issue

iosxcodeipad

提问by Eric

I am running Xcode 4.3.2. I am trying to build my project for archiving but I have been unable to figure out how to get the icons working. My initial goal is to just get it to build - I don't care if I have pretty icons at this point. This is a universal app.

我正在运行 Xcode 4.3.2。我正在尝试构建我的归档项目,但我一直无法弄清楚如何让图标工作。我最初的目标是让它构建 - 我不在乎此时我是否有漂亮的图标。这是一个通用的应用程序。

There is a lot of information out there on the Internet about editing your plist manually and I see in Summary there are places to define your icons, but none of it is working for me.

互联网上有很多关于手动编辑 plist 的信息,我在摘要中看到有一些地方可以定义您的图标,但没有一个对我有用。

warning: Icon specified in the Info.plist not found under the top level app wrapper: Icon.png (-19007)
Unable to validate your application. - (null)

warning: iPhone/iPod Touch: Info.plist: Unable to verify icon dimensions, no icon found.  You must define CFBundleIcons, CFBundleIconFiles, CFBundleIconFile, or provide a default Icon.png that is 57x57 (-19013)
Unable to validate your application. - (null)

warning: iPad: Info.plist: Unable to verify icon dimensions, no icon found.  You must define CFBundleIcons, CFBundleIconFiles, CFBundleIconFile, or provide a default Icon-72.png that is 72x72 (-19013)
Unable to validate your application. - (null)

回答by Mick MacCallum

If you have this in your info.plist

如果你的 info.plist 中有这个

enter image description here

在此处输入图片说明

Change it to this.

改成这样。

enter image description here

在此处输入图片说明

EDIT:Give it another try dragging your icon files from "Resources" directly to here... When it says it would like to copy them select YES.

编辑:再试一次将您的图标文件从“资源”直接拖到这里...当它说要复制它们时,选择是。

enter image description here

在此处输入图片说明

回答by Abhi Beckert

For me the fix was to delete all icon related entries in the Info.plist file, and then use the GUI in 0x7fffffff's screenshot to re-create the Info.plist entries.

对我来说,修复是删除 Info.plist 文件中所有与图标相关的条目,然后使用 0x7ffffffff 屏幕截图中的 GUI 重新创建 Info.plist 条目。

回答by marcwjj

Delete the icon files from your app folder, remove the Icon files line from info.plist.

从您的应用程序文件夹中删除图标文件,从 info.plist 中删除图标文件行。

Then drag the icon file (from another directory which is not your project folder) to the xcode App icons UI.

然后将图标文件(从不是您的项目文件夹的另一个目录)拖到 xcode 应用程序图标 UI。

Clean => Build and Run.

清洁 => 构建和运行。

回答by Nobu

Aside from NSPostWhenIdle's answer, I needed to add CFBundleIconFile ('Icon file'. Not 'Icon files'.) in the plist.

除了 NSPostWhenIdle 的回答,我需要在 plist 中添加 CFBundleIconFile ('Icon file'。不是 'Icon files'.)。

On Xcode 4.4.1.

在 Xcode 4.4.1 上。