ios 无效的图像路径 - 在键“CFBundleIconFile”下引用的路径中找不到图像:Icon.png

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

Invalid Image Path - No image found at the path referenced under key "CFBundleIconFile": Icon.png

iosios7application-loader

提问by Julia Zhao

I got this error from Application Loader when uploading my app to App Store. My app was developed at the time of iOS 3.0, and still targets at iOS 4.3 and above. I recently updated the app to make it iOS7-compatible. But the Application Loader always returned this type of error to me. I searched the Internet and found that I am not alone. So I created this post and hopefully what I found out about the app icons can help other people.

将我的应用程序上传到 App Store 时,我从 Application Loader 收到此错误。我的app是在iOS 3.0的时候开发的,目前还是针对iOS 4.3及以上。我最近更新了该应用程序,使其与 iOS7 兼容。但是应用程序加载程序总是向我返回这种类型的错误。我在网上搜索,发现我并不孤单。所以我创建了这篇文章,希望我发现的关于应用程序图标的内容可以帮助其他人。

回答by Wytze

Sounds like you may, like me, have accepted the suggestion by XCode 5.0 to migrate your icon files to a catalog.

听起来您可能像我一样接受了 XCode 5.0 的建议,将您的图标文件迁移到目录。

When you do that, you need to removethe CFBundleIconFile ("Icon file") parameter from your project's .plist file. That's the old way of doing this, and once you've migrated your icon files, obviously that parameter is incorrect.

执行此操作时,您需要从项目的 .plist 文件中删除CFBundleIconFile(“图标文件”)参数。这是执行此操作的旧方法,一旦您迁移了图标文件,显然该参数是不正确的。

Strange that XCode's migration doesn't fix this for you automatically. Would have been so very Apple to help you out there.

奇怪的是 XCode 的迁移并没有自动为你解决这个问题。Apple 会非常乐意为您提供帮助。

回答by Julia Zhao

If your app supports iOS 5.0 and up, moving all icon files to the Asset Catalog will work.

如果您的应用支持 iOS 5.0 及更高版本,将所有图标文件移动到资产目录即可。

If your app still needs to support lower versions of iOS (like mine), the solution is to use the CFBundleIconFiles key in the project plist file. In my case, my app is an iPhone-only app, so I did the following:

如果您的应用程序仍需要支持较低版本的 iOS(如我的),则解决方案是使用项目 plist 文件中的 CFBundleIconFiles 键。就我而言,我的应用程序是仅限 iPhone 的应用程序,因此我执行了以下操作:

  1. Prepare 8 icon files: two app icons for iOS6 and earlier (57x57 and 114x114), two icons for iOS7 (60x60 and 120x120), two icons for spotlight search/settings for iOS 6 and earlier (29x29 and 58x58), and two icons for spotlight (40x40 and 80x80). The files must be PNG files. Name these files whatever you want, but the high-resolution file name must in the form of [email protected]
  2. In the project plist file, edit the CFBundleIconFiles key (which is an array) to include the names of the above icon files. Only the low resolution file names are needed, and the extension (.png) should not be included. The Xcode will automatically find the high resolution files as long as their names follow the convention (with @2x).
  3. Make sure your project does not contain the Asset Catalog folder
  4. If you did the above things right, when you check the "General" section of the app target, you should see that Xcode has listed all the icon files in right place under the "app icons" section.
  5. If your app needs to support iOS 3.1 and earlier, you need to make four extra icon files. The size and the name of these files are as follows: Icon.png (57x57), [email protected] (114x114), Icon-Small.png (29x29), [email protected] (58x58). The fixed names are required by iOS and cannot be changed. But as long as you name the icon files that way, you don't need to do any extra things.
  1. 准备 8 个图标文件:iOS6 及更早版本的两个应用程序图标(57x57 和 114x114),iOS7 的两个图标(60x60 和 120x120),iOS 6 及更早版本的两个用于聚焦搜索/设置的图标(29x29 和 58x58),以及两个用于聚光灯(40x40 和 80x80)。这些文件必须是 PNG 文件。随意命名这些文件,但高分辨率文件名必须采用[email protected]的形式
  2. 在项目 plist 文件中,编辑 CFBundleIconFiles 键(它是一个数组)以包含上述图标文件的名称。只需要低分辨率文件名,不应包含扩展名 (.png)。只要名称遵循约定(使用@2x),Xcode 就会自动查找高分辨率文件。
  3. 确保您的项目不包含 Asset Catalog 文件夹
  4. 如果您正确地执行了上述操作,那么当您检查应用程序目标的“常规”部分时,您应该会看到 Xcode 已在“应用程序图标”部分下的正确位置列出了所有图标文件。
  5. 如果您的应用需要支持 iOS 3.1 及更早版本,则需要制作四个额外的图标文件。这些文件的大小和名称如下:Icon.png (57x57)、[email protected] (114x114)、Icon-Small.png (29x29)、[email protected] (58x58)。iOS 需要固定名称,不能更改。但是只要你这样命名图标文件,你就不需要做任何额外的事情。

After these steps, you should not have any problems with the icons when uploading your app to the App Store.

完成这些步骤后,将应用程序上传到 App Store 时,图标应该不会有任何问题。

The Asset Catalog simplies some of the above steps, e.g, generating low resolution icon files (my guess).

资产目录简化了上述一些步骤,例如,生成低分辨率图标文件(我的猜测)。

I got the above info from "iOS Human Interface Guidelines", "iOS app programming guide" and "information property list reference". Search for "app icons" and everthing is explained.

我从“iOS 人机界面指南”、“iOS 应用程序编程指南”和“信息属性列表参考”中获得了上述信息。搜索“应用程序图标”并解释一切。

回答by Elia Weiss

My solution was: in 'build phases', under 'copy bundle resources', click '+' and choose all your icons.

我的解决方案是:在“构建阶段”中,在“复制捆绑资源”下,单击“+”并选择所有图标。

good luck.

祝你好运。

回答by ShakeMan

Your recipe work's perfectly.

你的食谱很完美。

For my part,

对我来说,

I've select NameOfMyApp-info.plist in the Supporting Files.

我在支持文件中选择了 NameOfMyApp-info.plist。

I've only have to open the Key: Icon files.

我只需要打开 Key: Icon 文件。

I've just deleted all the string of image. (The error message in the Submit was exactly about those images.

我刚刚删除了所有图像字符串。(提交中的错误消息正是关于这些图像的。

I've try submiting again and : Submit Successful.

我已经尝试再次提交并:提交成功。

Thank's

谢谢

回答by user38932

None of the above solutions worked in my particular instance.

上述解决方案都不适用于我的特定情况。

In the end the following did work so in case anyone else has the same problem:

最后,以下确实有效,以防其他人遇到同样的问题:

  1. Remove the app-icon set that is causing the problem from the Asset Catalog
  2. In target properties from the navigator pane remove and then readd the 'Using Asset Catalog' for app icons - this will recreate an empty app-icon set
  3. Select your desired sizes and assign the correct images by dragging from the navigation pane
  4. Delete CFBundleIconFiles keys (there is a second one for iPad)
  5. Rebuild archive
  1. 从资产目录中删除导致问题的应用程序图标集
  2. 在导航器窗格中的目标属性中删除并读取应用程序图标的“使用资产目录” - 这将重新创建一个空的应用程序图标集
  3. 通过从导航窗格中拖动来选择所需的尺寸并分配正确的图像
  4. 删除 CFBundleIconFiles 键(iPad 有第二个键)
  5. 重建档案

回答by tavi

In order for me to fix this issue I had to add again one icon image.

为了解决这个问题,我不得不再次添加一个图标图像。

The error mentioned 'CFBundleIcons':AppIcon40x40file and when I checked the Images.xcassetsunder the AppIconimage set the image the Iphone Spotlight IOS 7-9 40ptwas in fact with the wrong resolution so I dragged again from Finder the icon with 80x80 resolution (40x40 multiplied by the scale factor 2x).

错误提到了“CFBundleIcons”:AppIcon40x40文件,当我检查图像Images.xcassets下的AppIcon图像设置图像时,Iphone Spotlight IOS 7-9 40pt的分辨率实际上是错误的,所以我再次从 Finder 中拖动了 80x80 分辨率的图标(40x40 乘以比例因子 2x)。

回答by osxdirk

This error can have several causes as it seems. In my case, two Icon Files had the wrong pixel dimensions (generated by cordova). So you might check that.

看起来这个错误可能有多种原因。就我而言,两个图标文件的像素尺寸错误(由cordova 生成)。所以你可以检查一下。

回答by Amal T S

Found the same issue while building Cordova project.

在构建 Cordova 项目时发现了同样的问题。

Removing CFBundleIconwith icon.pngin info.plistcleared the issue for me

删除CFBundleIcon的icon.pnginfo.plist清除了问题对我来说

回答by Amal T S

I basically went into the info.plist and removed the icons that I didn't need. I started out with the Cocos2d template and didn't need most of them, so I deleted them all. When I archived the program and went to validate it, it gave errors such as "where is this icon and that icon?" Well, I deleted them all. But in the info.plist all 13 icons were still listed, so I just removed all the ones I deleted.

我基本上进入了 info.plist 并删除了我不需要的图标。我从 Cocos2d 模板开始,不需要其中的大部分,所以我将它们全部删除。当我存档程序并去验证它时,它给出了诸如“这个图标和那个图标在哪里?”之类的错误。嗯,我都删了。但是在 info.plist 中仍然列出了所有 13 个图标,所以我只是删除了我删除的所有图标。