ios '缺少推荐的图标文件 - 捆绑包不包含 .png 格式的 iPhone / iPod Touch 应用程序图标,像素正好是 120x120'

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

'Missing recommended icon file - The bundle does not contain an app icon for iPhone / iPod Touch of exactly '120x120' pixels, in .png format'

iphoneiosios7itunes

提问by TelKitty

I submitted an app update, but I have received an email telling me this error has occurred:

我提交了一个应用更新,但我收到了一封电子邮件,告诉我发生了这个错误:

Missing recommended icon file - The bundle does not contain an app icon for iPhone / iPod Touch of exactly '120x120' pixels, in .png format

缺少推荐的图标文件 - 捆绑包不包含 .png 格式的精确“120x120”像素的 iPhone/iPod Touch 应用程序图标

How can I fix this problem?

我该如何解决这个问题?

Hereare the current icon requirements from Apple.

以下是 Apple 当前的图标要求。

I could not see 120x120 appearing anywhere? Is this iOS 7 specific? Should I include an icon named Icon-120.pngor something?

我看不到 120x120 出现在任何地方?这是 iOS 7 特定的吗?我应该包括一个名为Icon-120.png或什么的图标吗?

Update: I added three icons to the resource folder (Icon-120.png : 120x120, Icon-76.png: 76x76 & Icon-152.png: 152x152), but it did not add them to the info.plist. The same warning email was received. I decided to not change anything and wait to see what would happen next.

更新:我在资源文件夹中添加了三个图标(Icon-120.png: 120x120, Icon-76.png: 76x76 & Icon-152.png: 152x152),但它没有将它们添加到info.plist. 收到了同样的警告电子邮件。我决定不做任何改变,然后等着看接下来会发生什么。

To my utter amazement, the app went into the review stage 20 hours later and was released on the market the very next day! Kind of makes me wonder how many Apple/Windows app review people lurk around here.

令我惊讶的是,该应用程序在 20 小时后进入审核阶段,并于第二天在市场上发布!有点让我想知道有多少 Apple/Windows 应用程序评论人潜伏在这里。

回答by Nitin Gohel

If you get an icon errorwhen submitting an application from Xcode9, or if you cannot see app icon on your simulator as well as a device, just update your cocoapodsto the latest version in your project. That issue is a bug in Xcode9with cocoapods.

如果您error在从 提交应用程序时收到一个图标Xcode9,或者如果您在模拟器和设备上看不到应用程序图标,只需将cocoapods您的项目更新到最新版本即可。这个问题是一个bugXcode9cocoapods



There's a new guideline for iPhoneXthat can be seen here.

iPhoneX可以在此处查看新指南。



Here's a helpful website that creates an icon for iOS, Mac App and Android app.

是一个有用的网站,可为 iOS、Mac 应用程序和 Android 应用程序创建图标。

You just need to drag and drop your 1024 x 1024 icon and the site will create all the icon sizes and send it to your email. Then follow the following method to set icons for iOS app.

您只需要拖放 1024 x 1024 图标,网站就会创建所有图标大小并将其发送到您的电子邮件。然后按照以下方法为iOS应用设置图标。

After Apple launched iOS 8, iPhone 6 and 6 Plus, the app icon sizes and launch image sizes changed. Please visit my post for new sizes:

Apple 推出 iOS 8、iPhone 6 和 6 Plus 后,应用程序图标大小和启动图像大小发生了变化。请访问我的帖子以获取新尺寸:

Image resolution for new iPhone 6 and 6+, @3x support added?

新 iPhone 6 和 6+ 的图像分辨率,添加了@3x 支持?



Yes, you need to add a 120x120 high resolution icon. Now, if you want to target only iOS 7, you just need 76 x 76, 120 x 120 and 152 x 152 icon sizes. If you also want to target iOS 6, you'll need 57 x 57, 72 x 72, 76 x 76, 114 x 114, 120 x 120, 144 x 144 and 152 x 152icon sizes. Without counting Spotlight and Settings icon if you don't want the OS to interpolate them!

是的,您需要添加一个 120x120 的高分辨率图标。现在,如果您只想针对 iOS 7,您只需要 76 x 76、120 x 120 和 152 x 152 的图标大小。如果您还想针对 iOS 6,则需要57 x 57, 72 x 72, 76 x 76, 114 x 114, 120 x 120, 144 x 144 and 152 x 152图标大小。如果您不希望操作系统插入它们,则不计算 Spotlight 和设置图标!

Enter image description here

在此处输入图片说明

Enter image description here

在此处输入图片说明

As per the blog post New Metrics for iOS 7 App Icons.

根据博客文章iOS 7 应用程序图标的新指标

UPDATE:

更新:

As per Apple Guideline App-iconOR Icon and Image Sizes:

根据 Apple Guideline App-iconOR Icon and Image Sizes

Icon dimensions (iOS 7 and later)

图标尺寸(iOS 7 及更高版本)

Enter image description here

在此处输入图片说明

Icon dimensions (iOS 6.1 and earlier)

图标尺寸(iOS 6.1 及更早版本)

Enter image description here

在此处输入图片说明

Create different sizes of the app icon for different devices. If you're creating a universal app, you need to supply app icons in all four sizes.

为不同的设备创建不同大小的应用程序图标。如果您要创建通用应用程序,则需要提供所有四种尺寸的应用程序图标。

For iPhone and iPod touch, both of these sizes are required:

对于 iPhone 和 iPod touch,这两种尺寸都是必需的:

  • 120 x 120 pixels

  • 60 x 60 pixels (standard resolution)

  • 120 x 120 像素

  • 60 x 60 像素(标准分辨率)

For iPad, both of these sizes are required:

对于 iPad,这两种尺寸都是必需的:

  • 152 x 152

  • 76 x 76 pixels (standard resolution)

  • 152 × 152

  • 76 x 76 像素(标准分辨率)



Now set this into Project:

现在将其设置为项目:

  • Create a new icon with 120 pixels with high-resolution and 60 pixels as regular as above that the Apple documentation mentions and set the name. For example, icon-120.pngand icon-152.png.

  • Put this icons into your project Resourcefolder and add this icon into the project:

  • 创建一个具有 120 像素高分辨率和 60 像素的新图标,与 Apple 文档中提到的一样,并设置名称。例如,icon-120.pngicon-152.png

  • 将此图标放入您的项目资源文件夹并将此图标添加到项目中:

Enter image description here

在此处输入图片说明

  • After this, click on ProjectName-Info.plistand find the icon filesrow. If you can't find it, then add it by clicking the (+)sign and select icon files and then set all icon images like below.
  • 在此之后,单击ProjectName-Info.plist并找到图标文件行。如果找不到,请通过单击(+)符号添加它并选择图标文件,然后设置所有图标图像,如下所示。

Enter image description here

在此处输入图片说明

Enter image description here

在此处输入图片说明

Now archive and distribute your project as we did for submission of the app binary into the App Store. I hope now you can submit your app without any icon issue.

现在存档和分发您的项目,就像我们将应用程序二进制文件提交到App Store所做的那样。我希望现在您可以提交您的应用程序而不会出现任何图标问题。



NOTE:

笔记:

Be careful to provide all the icons you need. Otherwise your app will not pass Apple validation. If you've received this kind of email:

请小心提供您需要的所有图标。否则您的应用程序将无法通过 Apple 验证。如果您收到此类电子邮件:

Invalid Image - For iOS applications, icons included in the binary submission must be in the PNG format.

- If your application supports the iPhone device family, you must include square icons of the following dimensions: 57x57 pixels and 120x120 pixels.

- If your application supports the iPad device family, you must include square icons of the following dimensions: 72x72 pixels, 76x76 pixels and 152x152 pixels

Apple is now accepting applications that work on iOS 7 as well, so whatever the Deployment target6.1 or earlier, but you also need to provide the iOS 7 icon sizes as I mention above (that the store is expecting).

Apple 现在也接受适用于 iOS 7 的应用程序,因此无论是Deployment target6.1 或更早版本,但您还需要提供我上面提到的 iOS 7 图标大小(商店期望的)。

Xcode 5 app icon Manage

Xcode 5 应用程序图标管理

If you are using xCode5 The first thing to update is the icons. Xcode 5 introduces Asset Catalogsto simply managing multiple copies of an image (such as for multiple resolutions). We'll create one to manage both the Game's icons, along with the Launch Images.

如果您使用的是 xCode5,首先要更新的是图标。Xcode 5 引入了资产目录来简单地管理一个图像的多个副本(例如多个分辨率)。我们将创建一个来管理游戏的图标以及启动图像。

enter image description here

在此处输入图片说明

Now, click the Use Asset Catalog button. When confirming the migration, you're also asked if you wish to migrate the Launch Images (which is iOS talk for the splash screen that appears when starting your app) - you'll want to ensure this is checked as well.

现在,单击使用资产目录按钮。在确认迁移时,还会询问您是否希望迁移启动图像(这是启动应用程序时出现的初始屏幕的 iOS 对话) - 您还需要确保选中此项。

enter image description here

在此处输入图片说明

Please take a Look for more Info Apple doc of Asset Catalogs

请查看资产目录的 Apple 文档以获取更多信息

回答by Dan Rosenstark

The accepted answer is great, but here's the short answer:

接受的答案很好,但这是简短的答案:

<key>CFBundleIconFiles</key>
<array>
    <string>[email protected]</string>
    <string>icon.png</string>
    <string>Icon-Small.png</string>
    <string>[email protected]</string>
    <string>Default.png</string>
    <string>[email protected]</string>
    <string>icon-72.png</string>
    <string>[email protected]</string>
    <string>Icon-Small-50.png</string>
    <string>[email protected]</string>
    <string>Default-Landscape.png</string>
    <string>[email protected]</string>
    <string>Default-Portrait.png</string>
    <string>[email protected]</string>

New icons below here

下面的新图标

    <string>icon-40.png</string>
    <string>[email protected]</string>
    <string>icon-60.png</string>
    <string>[email protected]</string>
    <string>icon-76.png</string>
    <string>[email protected]</string>
</array>

Found this hereby searching for "The bundle does not contain an app icon for iPhone / iPod Touch of exactly '120x120' pixels, in .png format." in Google.

发现这个在这里通过搜索“的包不包含在.png格式为究竟‘120×120’像素,iPhone / iPod Touch的应用程序图标。” 在谷歌。

回答by Sam B

You don't have to do it this complicated way. If you are using XCode 5 (which I am sure most of us are) then create your icons call them whatever you like i.e.

您不必以这种复杂的方式进行操作。如果您使用的是 XCode 5(我相信我们大多数人都是这样),那么创建您的图标,您可以随意称呼它们,即

  • myIcon-58.png
  • myIcon-57.png
  • myIcon-72.png
  • myIcon-80.png
  • myIcon-100.png ....
  • myIcon-58.png
  • myIcon-57.png
  • myIcon-72.png
  • myIcon-80.png
  • myIcon-100.png ....

And drag and drop them on to the correct boxes under AppIcon. See screenshots. You don't have to manually edit plist file.

并将它们拖放到 AppIcon 下的正确框中。见截图。您不必手动编辑 plist 文件。

enter image description hereenter image description hereenter image description here

在此处输入图片说明在此处输入图片说明在此处输入图片说明

回答by Ketan P

One easy way if you have App icon of size 1024 X 1024. just upload it on below site, It will generate icon folder Add AppIcon.appiconsetin to your application.

如果您有大小为 1024 X 1024 的应用程序图标,一种简单的方法。只需将其上传到以下站点,它将生成图标文件夹添加AppIcon.appiconset到您的应用程序中。

Step 1:

第1步:

Upload your existing 1024 X 1024 icon on Below Site :

在下面的网站上上传您现有的 1024 X 1024 图标:

https://makeappicon.com/

https://makeappicon.com/

Step 2 :

第2步 :

It will send you mail.

它会给你发邮件。

Download icon.zip from email.

从电子邮件下载 icon.zip。

Step 3 : Drag and Drop AppIcon.appiconsetto your application. It will contain all require icon.

第 3 步:拖放AppIcon.appiconset到您的应用程序中。它将包含所有需要的图标。

It may help you all.

可能对大家有帮助。

Edit : I am not owner/ promoter of this site. It will save our time.

编辑:我不是本网站的所有者/发起人。它会节省我们的时间。

回答by Max Niagolov

In my case it was linked with CocoaPods. I've spent a bunch of time to find what was the reason, cause everything seemed correct. I found it over here https://github.com/CocoaPods/CocoaPods/issues/7003. I just moved the "[CP] Copy Pods Resources" and "[CP] Embed Pods Frameworks" above "Copy Bundle Resources" in the Build Phases and the error dissapeared.

就我而言,它与 CocoaPods 相关联。我花了很多时间来找出原因,因为一切似乎都是正确的。我在这里找到了它https://github.com/CocoaPods/CocoaPods/issues/7003。我刚刚在构建阶段将“[CP] Copy Pods Resources”和“[CP] Embed Pods Frameworks”移到“Copy Bundle Resources”上方,错误消失了。

回答by thst

I want to add another pitfall. Even if you did everything right, you may get trapped by this error if you support more than one target in your build process.

我想添加另一个陷阱。即使您做的一切正确,如果您在构建过程中支持多个目标,您也可能会陷入此错误。

The image asset catalog is part of a target and even if you selected it in Xcode5 to be usedfor your target, it does not mean it is automatically added.

图像资产目录是目标的一部分,即使您在 Xcode5 中选择它用于目标,也不意味着它会自动添加

As a result, the build works like a charm, but the asset catalog is not added to the IPA and the AppStore validation fails with the Error, that the icons are missing.

结果,构建就像一个魅力,但资产目录没有添加到 IPA 并且 AppStore 验证失败并显示错误,即图标丢失。

To fix or check that the assets are part of the target, select the assets-entry in the Xcode project and make sure your target is checked in the inspector.

要修复或检查资产是否是目标的一部分,请选择 Xcode 项目中的资产条目,并确保在检查器中检查您的目标。

回答by girish_vr

I faced the same issue while submitting the app using Xcode 4.6. It does not recognise the icons with dimension 120x120, 58x58, 29x29, etc. So when I tried to add these icons into the info.plist and submit the app for review, Xcode 4.6 did not allow me to do so. On submitting the app without the above icons, I got a mail saying -

我在使用 Xcode 4.6 提交应用程序时遇到了同样的问题。它无法识别尺寸为 120x120、58x58、29x29 等的图标。因此,当我尝试将这些图标添加到 info.plist 并提交应用程序进行审核时,Xcode 4.6 不允许我这样做。在提交没有上述图标的应用程序时,我收到一封邮件说 -

"Your delivery was successful, but you may wish to correct the following issues in your next delivery: Missing recommended icon file - The bundle does not contain an app icon for iPhone / iPod Touch of exactly '120x120' pixels, in .png format."

“您的交付已成功,但您可能希望在下次交付时更正以下问题: 缺少推荐的图标文件 - 捆绑包不包含 .png 格式的 iPhone / iPod Touch 应用程序图标,其大小正好是“120x120”像素。 ”

Since, it was recommended and not necessary, I submitted the app anyhow. I added the above recommended icons to the bundle but did not specify them in the Info.plist. I got the same mail again. This time I ignored it and to my surprise the app was accepted.

因为,这是推荐的而不是必要的,我无论如何都提交了该应用程序。我将上面推荐的图标添加到包中,但没有在 Info.plist 中指定它们。我又收到了同样的邮件。这次我忽略了它,令我惊讶的是该应用程序被接受了。

I wanted my app to run on iOS 5 and above and therefore, I had to use Xcode 4.6 and not the latest Xcode 5 which properly allows only apps for iOS7 and above only.

我希望我的应用程序在 iOS 5 及更高版本上运行,因此,我必须使用 Xcode 4.6 而不是最新的 Xcode 5,后者仅正确地允许仅适用于 iOS7 及更高版本的应用程序。

UPDATE:

更新:

NOTE: "Starting February 1st 2014 new apps and app updates submitted to the App Store must be built with Xcode 5 and iOS 7 SDK". https://developer.apple.com/news/?id=12172013a#top

注意:“从 2014 年 2 月 1 日开始,提交到 App Store 的新应用程序和应用程序更新必须使用 Xcode 5 和 iOS 7 SDK 构建”。 https://developer.apple.com/news/?id=12172013a#top

Thus, this scenario will be invalid in future.

因此,这种情况在未来将无效。

回答by user1169629

This should be called a warning, not an error. At least the email says that the icon file is "recommended" and not "required". You can safely ignore this warning if you target iOS 6. Of course, for iOS 7 you would need the new dimensions and also look out for the new rounding of the icon's corners

这应该称为警告,而不是错误。至少电子邮件说该图标文件是“推荐的”而不是“必需的”。如果您的目标是 iOS 6,则可以放心地忽略此警告。当然,对于 iOS 7,您需要新的尺寸并注意图标角的新圆角

回答by Daniel Maclean

For any Xamarin.iOS or Xamarin.Forms developers, additionally you will want to check the .csproj file (for the iOS project) and ensure that it contains references to the PNG's and not just the Asset Catalog i.e.

对于任何 Xamarin.iOS 或 Xamarin.Forms 开发人员,您还需要检查 .csproj 文件(对于 iOS 项目)并确保它包含对 PNG 的引用,而不仅仅是资产目录,即

<ItemGroup>
<ImageAsset Include="Resources\Images.xcassets\AppIcon.appiconset\Contents.json" />
<ImageAsset Include="Resources\Images.xcassets\AppIcon.appiconset\Icon-40.png" />
<ImageAsset Include="Resources\Images.xcassets\AppIcon.appiconset\Icon-40%402x.png" />
<ImageAsset Include="Resources\Images.xcassets\AppIcon.appiconset\Icon-40%403x.png" />
<ImageAsset Include="Resources\Images.xcassets\AppIcon.appiconset\Icon-60%402x.png" />
<ImageAsset Include="Resources\Images.xcassets\AppIcon.appiconset\Icon-60%403x.png" />
<ImageAsset Include="Resources\Images.xcassets\AppIcon.appiconset\Icon-72.png" />
<ImageAsset Include="Resources\Images.xcassets\AppIcon.appiconset\Icon-72%402x.png" />
<ImageAsset Include="Resources\Images.xcassets\AppIcon.appiconset\Icon-76.png" />
<ImageAsset Include="Resources\Images.xcassets\AppIcon.appiconset\Icon-76%402x.png" />
<ImageAsset Include="Resources\Images.xcassets\AppIcon.appiconset\Icon-83.5%402x.png" />
<ImageAsset Include="Resources\Images.xcassets\AppIcon.appiconset\Icon-Small-50.png" />
<ImageAsset Include="Resources\Images.xcassets\AppIcon.appiconset\Icon-Small-50%402x.png" />
<ImageAsset Include="Resources\Images.xcassets\AppIcon.appiconset\Icon-Small.png" />
<ImageAsset Include="Resources\Images.xcassets\AppIcon.appiconset\Icon-Small%402x.png" />
<ImageAsset Include="Resources\Images.xcassets\AppIcon.appiconset\Icon-Small%403x.png" />
<ImageAsset Include="Resources\Images.xcassets\AppIcon.appiconset\Icon.png" />
<ImageAsset Include="Resources\Images.xcassets\AppIcon.appiconset\Icon%402x.png" />
<ImageAsset Include="Resources\Images.xcassets\AppIcon.appiconset\NotificationIcon%402x.png" />
<ImageAsset Include="Resources\Images.xcassets\AppIcon.appiconset\NotificationIcon%403x.png" />
<ImageAsset Include="Resources\Images.xcassets\AppIcon.appiconset\NotificationIcon~ipad.png" />
<ImageAsset Include="Resources\Images.xcassets\AppIcon.appiconset\NotificationIcon~ipad%402x.png" />
</ItemGroup>

回答by Uwe

Just had same problem. Using Xcode 8.3.3 and wanted to use AppIcon in Assests catalogue. Tried all sorts of Stack Overflow answers without success.

刚刚有同样的问题。使用 Xcode 8.3.3 并想在资产目录中使用 AppIcon。尝试了各种 Stack Overflow 的答案,但没有成功。

Finally learned about a deep clean step from Ken/Apple Forum:

终于从 Ken/Apple 论坛了解到了一个深度清理步骤:

  • removed all icon files, whether from resources (delete - trash) or appicon file (select - remove selected items); removed even assets folder
  • deep cleaned (Use the Product menu w/option key pressed, then choose to 'clean build folder')
  • added a new asset catalogue and called it "Assets" right clicked in Assets folder and added new app icon set - changed that one in inspector to be for iOS >=7 triple

  • checked all my icon files OUTSIDE of Xcode (all were already png files of right resolution, but some had still colour profile attached from photoshop elements or did have indexed colour instead of RGB profile. so I made sure I only save a png file without colour profile and from a background layer) - not sure that was necessary

  • archived the build from Product menu
  • validated and uploaded the build from Window - Organizer
  • 删除所有图标文件,无论是从资源(删除 - 垃圾箱)还是 appicon 文件(选择 - 删除所选项目);删除偶数资产文件夹
  • 深度清理(使用带有选项键的产品菜单,然后选择“清理构建文件夹”)
  • 添加了一个新的资产目录并将其命名为“资产”,在资产文件夹中右键单击并添加新的应用程序图标集 - 在检查器中将其更改为 iOS >=7 三重

  • 检查了我在 Xcode 之外的所有图标文件(都已经是分辨率正确的 png 文件,但有些仍然从 photoshop 元素附加了颜色配置文件,或者确实有索引颜色而不是 RGB 配置文件。所以我确保我只保存一个没有颜色的 png 文件个人资料和背景层) - 不确定这是必要的

  • 从产品菜单归档构建
  • 从 Window - Organizer 验证并上传构建