Icon.png 出现问题(在顶级应用程序包装器下找不到 Info.plist 中指定的图标:Icon.png (-19007))

发布于 2024-10-11 08:09:11 字数 496 浏览 5 评论 0原文

我正在组装一个通用应用程序,并且我的项目中有图标,但我不断收到编译器关于 Icon.png 的警告。

我按照 http://developer.apple.com/library 的说明进行操作/ios/#qa/qa2010/qa1686.html 但仍然出现上述错误。

我尝试执行以下操作:

将图标放入共享组中,并根据技术说明根据 plist 添加它们。 更改图标路径以将 Shared/ 添加到其中以指向共享文件夹。

创建一个资源组(技术说明没有指出 XCode 不会为通用应用程序创建资源组)并将它们移动到该组中(我从 plist 中删除了“Shared/”前缀。)

将图标移动到项目的顶层。

我还仔细检查了图标大小以及每个图标的名称,它们都是正确的。

我可能错过了什么吗?

I'm putting together a universal app and I have the icons in my project, but I keep getting a warning from the compiler in regards to Icon.png.

I followed the instructions at http://developer.apple.com/library/ios/#qa/qa2010/qa1686.html but still get the above error.

I've tried doing the following:

Putting the icons in the Shared group and adding them according to the plist according to the tech note.
Changing the icon paths to add Shared/ to them to point to the shared folder.

Creating a Resources group (which the tech note fails to point out that XCode doesn't create a Resources Group for a universal app) and moving them into that (I removed the "Shared/" prefixes from the plist.)

Moving the icons to the top level of the project.

I've also double-checked the icon sizes and they are all correct, as well as the names of each.

Anything I might have missed?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(26

百变从容 2024-10-18 08:09:12

我遇到了完全相同的问题。当您构建并存档时,单击“在查找器中显示”,显示存档包的内容并检查是否所有文件都显示出来。对我来说,由于某种原因,存档缺少 Icon.png 文件。存档实用程序有一个错误。我将图标从资源文件夹中移出,清理并构建了项目。然后我再次将图标移到资源文件夹中并清理和构建它。然后存档复制了丢失的图标文件。

I had the exact same problem. When you build and archive, click show in finder, show the contents of the package of the archive and check if all the files are showing up. For me, the archive was missing Icon.png file for some reason. The archive utility has a bug. I moved the icons out of the resource folder, cleaned and built the project. Then again I moved the icons into the resource folder and cleaned and built it. Then the archive had copied the missing icon files.

负佳期 2024-10-18 08:09:12

也有空字符串节点,但它没有反映在 Xcode 中。不知何故,info-plist 文件与文件系统不同步。我必须删除对它的引用并将其重新添加到我的项目中,然后我看到了 .解决这个问题解决了我的问题。

Had the empty string node as well, but it wasn't reflected in Xcode. Somehow, the info-plist file was out of sync with the filesystem. I had to remove the reference to it and re-add it to my project, THEN I saw the . Fixing that fixed my problem.

毅然前行 2024-10-18 08:09:12
  1. 从 xcode 界面中删除所有图标文件
  2. 将项目文件夹中的所有文件移动到桌面上的某个文件夹
  3. 重命名最近创建的桌面文件夹中的文件
  4. 删除图标的 info-plist 文件中的所有条目
  5. 通过拖动到 Xcode 窗口的适当位置来重新开始分配图标。
  6. 当您为 iphone 创建图标时,xcode 会自动将这些图标分配给 ipad。
    请勿删除 IPAD 部分中的条目。相反,拖入 IPAD 相关图标来替换旧图标。请记住,这很重要。
  7. 创建档案。
  1. Remove all icon files from xcode interface
  2. Move all files from your project folder to some folder on desktop
  3. rename the files in recently created desktop folder
  4. delete all entries from info-plist file for icons
  5. start assigning icons again by dragging onto Xcode window at appropriate places.
  6. When you create icons for iphone, xcode automatically assigns those icons to ipad.
    DO NOT DELETE THE ENTRIES IN IPAD SECTION. INSTEAD, DRAG IN THE IPAD RELATED ICONS TO REPLACE THE OLD ONES. Rememeber, this is important.
  7. Create archive.
梦亿 2024-10-18 08:09:12

将您的图标文件添加到“构建阶段”-> “复制捆绑资源”

希望有帮助......

Add your Icon-files to "Build Phases" -> "Copy Bundle Resources"

Hope it helps...

寒冷纷飞旳雪 2024-10-18 08:09:12

右键单击图标文件并选择获取信息。选择“目标”选项卡并确保选中您正在构建的目标。仅仅因为文件位于项目中,并不一定意味着它被复制到应用程序包中。

Right-click on the icon files and select Get Info. Pick the Targets tab and ensure that the target you are building is ticked. Just because a file is in the project, it doesn't necessarily mean that it is copied into the app bundle.

演出会有结束 2024-10-18 08:09:12

我遇到了完全相同的错误,清理项目并再次构建对我有用。这绝对是 Xcode 问题 - 即使在 4.0.2 上也是如此。您使用的是哪个版本的 Xcode?尝试更新到最新。

I had the exact same error, cleaning the project and building again worked for me. It is definitely an Xcode issue - even on 4.0.2. Which version of Xcode are you using? Try updating to the latest.

妄断弥空 2024-10-18 08:09:12

我也遇到了同样的错误,也是使用通用应用程序。我有一个来自 Xcode 3 的项目(已经提交到商店)。我在 Xcode 4 中打开,当您单击目标时,看到了精美的图像链接页面(单击目标、“摘要”和“应用程序部署信息”)。在链接各种图标、测试、编译然后存档后,我得到了这个错误。

一件额外的事情 - 我手动将图标名称添加到 Xcode 3 中的 plist 中。我的猜测是,这与 Xcode 4 中的图像链接功能相冲突。所以我删除了 plist 中的一个条目“icon”。新的图像链接器将 plist 条目创建为数组。我保持不变,尽管我确实用我的包中的图像名称验证了文件名,并在两个地方都大写了其中一个。我删除了有问题的图像并将其添加回捆绑包中。

我验证了并且通过了。

我的猜测是,“特殊”图标名称(动态链接到应用程序中的某些功能)将比随机名称更敏感。借助新的图像链接功能,您可以将图标文件命名为您想要的任何名称。

希望这有帮助。

I was getting the same error, also with a universal app. I had a project from Xcode 3 (already submitted to store). I opened in Xcode 4 and saw the fancy image-linking page (click on target, "summary" and "app deployment info") when you click on the target. After linking various icons, testing, compiling, and then archiving, I got this error.

One extra thing- I'd added the icon names byhand in to the plist in Xcode 3. My guess is that this was conflicting with the image-linking feature in Xcode 4. So I removed one entry, "icon" in the plist. The new image-linker creates plist entries as an array. I left that the same, though I did verify the filenames with the image names in my bundle, and capitalized one of them in both places. I removed and added back the problematic image to the bundle.

I validated and it passed.

My guess is that "special" icon names- that are dynamically linked to certain features in the app- are going to be more sensitive than random ones. With the new image-linking ability, you can name your icon files anything you want.

Hope this helps.

最丧也最甜 2024-10-18 08:09:12

当我的 Info.plist 中有一个额外的空行时,我也遇到了这个错误。我有项目 0,它是 Icon.png,我有项目 1,它是空白的。第 1 项曾经是我的 iPad 图标,但我清除了它。然后存档给了我你看到的警告。删除第 1 项的行完全解决了该问题。

I also got this error when I had an extra blank line in my Info.plist. I had Item 0, which was Icon.png, and I had Item 1, which was blank. Item 1 had been my iPad icon, but I cleared it. Archiving then gave me the warning you saw. Removing the line for Item 1 completely fixed the issue.

孤凫 2024-10-18 08:09:12

在 xcode 4.2 中也有同样的问题。注意到我的 plist 中的图标字符串包含名为“icon.png”和“Icon.png”的项目。我的图标文件名为 icon.png,因此尝试删除字符串“Icon.png”。这不起作用,但决定将我的资源重命名为“Icon.png”,将它们从项目中删除,然后将它们添加回来。清理、构建并成功!

Had the same problem in xcode 4.2. Noticed my plist had strings for icon had items named both "icon.png' and 'Icon.png'. My icon file was named icon.png so tried deleting the string "Icon.png". This didn't work but decided to rename my asset 'Icon.png', removed them from the project and added them back in. Clean, build and success!

剩余の解释 2024-10-18 08:09:12

在 AppName.xcodeproj/project.pbxproj 中,我更改了 icon.png -> 的出现次数Icon.png 且验证已通过。

In AppName.xcodeproj/project.pbxproj i changed the occurrences of icon.png -> Icon.png and the validations passed.

少女七分熟 2024-10-18 08:09:12

我的 [email protected] 图标文件遇到此问题。该文件似乎不在构建目标中(其属性的目标成员资格部分)。

解决方案是将其添加到目标中。 XCode 错误地允许将不在目标中的文件添加到图标列表中。

正如另一个答案所说,使用查找器浏览存档文件很明显该文件不存在。尽管如此,仍需要调查区分大小写或其他 plist 错误。

I had this problem with a [email protected] icon file. It seems that the file was not in the build target (the Target Membership part of its properties).

The solution was to add it to the target. XCode mistakenly allowed files not in the target to be added to the list of icons.

As another answer said, using the finder to browse the Archive file makes it obvious that the file is not present. Still, case sensitivity or other plist errors need to be investigated.

心舞飞扬 2024-10-18 08:09:12

根据我的经验,当项目中使用的一个或多个 png 文件损坏时,通常会出现这种错误。 png 文件可能是交错的,这会导致此类错误。

Based on my experience this kind of error usually shows up when one or more of the png files that were used in the project were corrupted. It's possible that the png file is interlaced which will cause this kind of error.

只涨不跌 2024-10-18 08:09:12
  1. 清理您的构建
  2. 确保文件实际上位于文件系统上
  3. 确保您可以在项目导航器中看到该文件。
  4. 第 3 步很可能会失败。如果是这样,请将图标从查找器拖到项目导航器上。当询问时,取消选中“复制..blabla”选项,因为由于文件已经存在于您将其拖动到的位置,因此它会失败。
    一旦文件出现在项目导航器中,您就应该很高兴了。
  5. 将此答案投票为“答案”:)
  1. Clean your build
  2. Make sure the file is actually on the file system
  3. Make sure you can see the file in the project navigator.
  4. Most likely step 3 will fail. If so, drag the icon from the finder onto the Project Navigator. When asked, uncheck the "copy ..blabla" option because since the file is already there where you are dragging it to, it would fail.
    Once the file shows up in the Project Navigator you should be golden.
  5. Vote this answer as "the answer" :)
做个ˇ局外人 2024-10-18 08:09:12

今晚刚刚遇到这个问题 - 它不足以正确命名并放在正确的文件夹中。如果我正确解释的话,请确保将其拖到 x 代码文件夹结构中。在文件夹视图中,确保它们确实列在其中。

just ran into this tonight - its not good enough to be named correctly and in the proper folder. make sure you drag it into the x-code folder structure if i'm explaining that properly. in the folder view, make sure their actually listed in there.

没有你我更好 2024-10-18 08:09:12

对我来说同样的问题;我通过在 info.plist 中将“压缩 PNG 文件”设置为“否”来解决。清理、存档、验证、成功。

Same issue for me; I resolved by setting "Compress PNG Files" to "NO" in info.plist. Cleaned, archived, validated, success.

不甘平庸 2024-10-18 08:09:12

构建 5.1 应用程序时遇到同样的问题。

只需删除有问题的文件并将其发送到垃圾箱即可。然后重新导入,确保选中复制按钮。

清洁-> 现在构建

有效。我猜这些文件没有被复制,因为它们应该是......

Had the same issue building a 5.1 app.

Just simply removed and send to trash the offending files. Then re-imported, making sure the copy button was ticked.

Clean -> Build

Now works. I guess those files weren't being copied over as they should have been..

顾北清歌寒 2024-10-18 08:09:12

我在这个问题上也花了太多时间!

在“目标/信息”选项卡中,我发现两个部分中有空行,分别位于“图标文件”和“图标文件 ->”下。主图标 ->图标文件。

您需要删除两个部分中的空行才能存档和验证应用程序。

I spent far too much time on this issue too!

In the Targets / Info tab I found that I had empty rows in two sections, both under Icon files and under Icon files -> Primary Icon -> Icon files.

You need to remove the empty lines in BOTH sections to be able to archive and validate the app.

还不是爱你 2024-10-18 08:09:12

这种方法对我有用,我不需要重命名文件和所有其他好东西。

我在右键单击上下文菜单中找到了一个名为 将文件添加到 [项目]...

第 1 步

打开 XCode 并确保您正在查看项目视图的 方法它以树形形式列出了下面的项目和顶级文件。

第 2 步

按住 Cmd 键单击或右键单击项目名称(位于左侧边栏顶部),然后指向“将文件添加到 [项目名称]...”

第 3 步 strong>

浏览需要添加的文件。您会注意到,已添加的文件呈灰色,而其他未添加的文件则以全彩显示。

This method worked for me and I did not need to rename files and all that other good stuff.

I found a method in the right-click context menu called Add Files to [Project]...

Step 1

Open XCode and make sure you are looking at your project view where it lists the project and top-level files below in a tree-style.

Step 2

Cmd-click or right-click on the Project Name (at top of left sidebar) and then point to "Add Files to [Project Name]..."

Step 3

Browse for files needing to be added. You will notice that files already added are greyed out whereas others that are not added stand out in full colour.

绻影浮沉 2024-10-18 08:09:12

我使用的是 Xcode 4.3.3。
我通过将自定义 icon.png 文件从放置它的文件夹拖到项目(ApplicationName-Resources-icons 文件夹)中解决了该问题。
之后,我的图标文件夹如下所示:

所以之前添加了缺少的“icon.png”。此后验证通过。

I am using Xcode 4.3.3.
I solved the problem, by dragging my custom icon.png file from a folder where I placed it, into the project (ApplicationName-Resources-icons Folder).
After this, my icons folder looked like this:

So the before missing "icon.png" has been added. Thereafter the validation passed.

病毒体 2024-10-18 08:09:12

这里同样的错误。
当我在 Xcode 4 中打开旧项目时会发生这种情况。
解决办法是:

  • 找到.plist文件,搜索关键的Icon文件(不是“Icon
    文件”或“图标文件(iOS 5)”)。

  • 删除它(减号按钮)。

  • 再次添加它并将文件名放入值

  • Product->Clean 和 Product->Build 再次。

Same error here.
It happens when I open an old project in Xcode 4.
The solutions is to:

  • find the .plist file, search for the key Icon file (Not "Icon
    files" or "Icon files (iOS 5)").

  • Delete it (minus button).

  • Add it again and put the filename in value

  • Product->Clean and Product->Build again.

护你周全 2024-10-18 08:09:12

这个问题快把我逼疯了!我尝试了这里发布的所有内容。

这对我来说是这样的:

  • 产品 ->存档
  • 在管理器窗口中 ->存档 右键单击​​创建的存档
  • 选择“在 Finder 中显示”
  • 右键单击​​ {YourAppArchive}.xcarchive 并选择“显示包内容”
  • 转至产品 ->应用程序
  • 右键单击 {YourApp} 并选择“显示包内容”
  • 将缺少的图标文件复制到此处
  • 返回到 Xcode 管理器并点击“验证...”

This problem was driving me crazy! I tried everything posted here.

This is how it worked for me:

  • Product -> Archive
  • In organizer windows -> Archives right-click on the created archive
  • Select "Show in Finder"
  • right-click on {YourAppArchive}.xcarchive and select "Show packages contents"
  • go to Products -> Applications
  • right-click on {YourApp} and select "Show packages contents"
  • Copy the missing Icon files here
  • Go back to Xcode organizer and hit "Validate..."
一紙繁鸢 2024-10-18 08:09:11

由于某种原因(可能是在添加多个图标并更改文件时?)该项目被移动到项目 1-...
确保您的图标在 plist 中列为 item 0

enter image此处描述

For some reason the (possibly when adding multiple icons and changing the file?) the item gets moved to item 1-...
Make sure your icon is listed as item 0 in the plist

enter image description here

千纸鹤 2024-10-18 08:09:11

我有同样的问题并找到适合我的解决方案。
请尝试以下步骤:

  • 构建>清理所有目标
  • 将 Icon.png 重命名为 xcon.png
  • 将 xcon.png 重命名为 Icon.png
  • 构建 >构建并存档
  • 重新提交到 iTunes connect - 成功!

大多数情况下,除了更改 Icon.png 的名称并将其改回来之外什么都不做,但它有效!

我曾尝试使用512*512的Icon.png进行学习,但后来我复制了一个新的57*57的图标回来,然后问题就出来了,我想也许是这个问题的原因。

我是 mac 新手。我的 XCode4 每天大约崩溃 10 次。我缺少视觉工作室。

I have same problem and find a solution works for me.
Please try below steps:

  • Build > Clean All Targets
  • Renamed Icon.png to xcon.png
  • Renamed xcon.png to Icon.png
  • Build > Build and Archive
  • Resubmitted to iTunes connect - success!

Mostly do nothing but change the name of the Icon.png and change it back, but it works!

I have tried to use a 512*512 Icon.png for learning, but I copy a new one of 57*57 back later, then the issue come out, I think maybe it's the reason of this issue.

I am new on mac. My XCode4 crashes about 10 times a day. I am missing Visual studio.

听闻余生 2024-10-18 08:09:11

这是我对这个问题的解决方案。 MyApp-Info.plist 文件中存在空字符串。我手动删除了它(在文本编辑器中),并且我的应用程序已验证并上传。

<key>CFBundleIcons</key>
<dict>
    <key>CFBundlePrimaryIcon</key>
    <dict>
        <key>CFBundleIconFiles</key>
        <array>
            <string></string> <--------- Extra string shouldn't be there------
            <string>[email protected]</string>
            <string>Icon.png</string>
        </array>
    </dict>
</dict>

Here was my solution to this problem. There was an empty string in the MyApp-Info.plist file. I manually deleted it (in a text editor) and my app verified and uploaded.

<key>CFBundleIcons</key>
<dict>
    <key>CFBundlePrimaryIcon</key>
    <dict>
        <key>CFBundleIconFiles</key>
        <array>
            <string></string> <--------- Extra string shouldn't be there------
            <string>[email protected]</string>
            <string>Icon.png</string>
        </array>
    </dict>
</dict>
九命猫 2024-10-18 08:09:11

我有这个问题。我的答案是检查大小写。在我的 plist 中,我有 Icon-small-50.png Icon-small.png 和 [email  protected] 我将 S 大写,问题就消失了。例如 Icon-Small-50.png Icon-Small.png 和 [电子邮件受保护]

I had this issue. The answer for me was to check the capitalization. In my plist I had Icon-small-50.png Icon-small.png and [email protected] I capitalized the S and the issue went away. e.g. Icon-Small-50.png Icon-Small.png and [email protected]

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文