ios Xcode9 iOS11 应用程序版本中缺少 CFBundleIconName

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

Missing CFBundleIconName in Xcode9 iOS11 app release

iosxcodeapp-store-connectios11xcode9

提问by ErAcube

I'm struggling to release a new version of our app using Xcode 9 built with iOS 11 SDK. Archiving and uploading the binary goes well without any issue. The build appears in iTunes Connect under Activity as 'processing' and it gets disappear and I get the following email back.

我正在努力使用使用 iOS 11 SDK 构建的 Xcode 9 发布我们应用程序的新版本。存档和上传二进制文件很顺利,没有任何问题。该构建在 iTunes Connect 中的 Activity 下显示为“正在处理”,它消失了,我收到了以下电子邮件。

Dear developer,

We have discovered one or more issues with your recent delivery for "". To process your delivery, the following issues must be corrected: Missing Info.plist value - A value for the Info.plist key CFBundleIconName is missing in the bundle ''. Apps that provide icons in the asset catalog must also provide this Info.plist key. For more information see http://help.apple.com/xcode/mac/current/#/dev10510b1f7. Once these issues have been corrected, you can then redeliver the corrected binary. Regards, The App Store team

亲爱的开发者,

我们发现您最近的“”交货有一个或多个问题。要处理您的交付,必须更正以下问题: 缺少 Info.plist 值 - 包 '' 中缺少 Info.plist 键 CFBundleIconName 的值。在资产目录中提供图标的应用程序也必须提供这个 Info.plist 键。有关更多信息,请参阅 http://help.apple.com/xcode/mac/current/#/dev10510b1f7。更正这些问题后,您就可以重新交付更正后的二进制文件。问候, App Store 团队

The link gives some info about asset bundles. I tried setting a CFBundleIconName key to project name or an image file name and submitted the app again. However, I still get the same email as above.

该链接提供了有关资产包的一些信息。我尝试将 CFBundleIconName 键设置为项目名称或图像文件名,然后再次提交应用程序。但是,我仍然收到与上述相同的电子邮件。

Any suggestion of help would be highly appreciated.

任何帮助建议将不胜感激。

采纳答案by ErAcube

I figured it out that since Xcode 9 iOS 11 builds require iTunes Connect App Icon to be bundled with the binary itself which could have been added to iTunes Connect directly in the earlier versions of Xcode (XCode 8.3.3 ane earlier).

我发现,由于 Xcode 9 iOS 11 构建需要 iTunes Connect App Icon 与二进制文件本身捆绑在一起,而二进制文件本身可以直接在早期版本的 Xcode(XCode 8.3.3 和更早版本)中添加到 iTunes Connect。

If you distribute your app through the App Store, add the App Store icon to an asset catalog located in the Xcode project. The location of the icon is different depending on the platform.

For iOS and watchOS apps built using Xcode 8.3.3 and earlier, you add the App Store icon in iTunes Connect. For macOS and tvOS apps, you add the App Store icon to the Xcode project but the location in the asset catalog is different than apps built with Xcode 9 and later.

如果您通过 App Store 分发您的应用程序,请将 App Store 图标添加到位于 Xcode 项目中的资产目录。图标的位置因平台而异。

对于使用 Xcode 8.3.3 及更早版本构建的 iOS 和 watchOS 应用程序,您可以在 iTunes Connect 中添加 App Store 图标。对于 macOS 和 tvOS 应用程序,您将 App Store 图标添加到 Xcode 项目,但资产目录中的位置与使用 Xcode 9 及更高版本构建的应用程序不同。

The required App Store icon should be placed in an asset catalog located in the app bundle.

所需的 App Store 图标应放置在位于应用程序包中的资产目录中。

Adding App Store Icon

添加应用商店图标

So, the CFBundleIconName should be now set to AppIcon (default value) or any value you set.

因此,现在应将 CFBundleIconName 设置为 AppIcon(默认值)或您设置的任何值。

Adding only that image will not pass the iTunes Archive upload process so we need to add all the App Icons images of the following sizes:

仅添加该图像不会通过 iTunes Archive 上传过程,因此我们需要添加以下大小的所有 App Icons 图像:

  • 20pt 1x, 2x, 3x
  • 29pt 1x, 2x, 3x
  • 40pt 1x, 2x, 3x
  • 60pt 1x, 2x, 3x
  • 76pt 1x, 2x
  • 83.5pt 2x
  • 1024pt 1x
  • 20pt 1x, 2x, 3x
  • 29pt 1x, 2x, 3x
  • 40pt 1x, 2x, 3x
  • 60pt 1x、2x、3x
  • 76pt 1x, 2x
  • 83.5pt 2x
  • 1024pt 1x

So, now it is time to use asset catalog to specify app icons.

所以,现在是时候使用资产目录来指定应用程序图标了。

回答by Richie Hyatt

I struggled with this all day and into the night trying every permutation I could think of and finally found this solution - hopefully this will save someone from going through this nightmare.

我一整天都在为此苦苦挣扎,直到深夜尝试了我能想到的每一种排列方式,最后找到了这个解决方案——希望这能让某人免于经历这场噩梦。

My app was not previously using an xcassets catalog so I had added one to the project when trying to address this issue by using File - New - File... and choosing an asset catalog from the types of files - I named it Assets.xcassets and chose it in the xcode project. Then right clicked in the area on the right and chose to add App Icons & Launch Images then New iOS App Icon and then in that I dragged my 1024x1024 image to the well for app store iOS 1024pt slot which you would think would have worked. but I still got rejected emails after archiving and submitting to the store.

我的应用程序以前没有使用 xcassets 目录,因此在尝试通过使用文件 - 新建 - 文件...并从文件类型中选择资产目录来解决此问题时,我向项目添加了一个目录 - 我将其命名为 Assets.xcassets并在 xcode 项目中选择它。然后右键单击右侧区域并选择添加应用程序图标和启动图像,然后选择添加新的 iOS 应用程序图标,然后我将我的 1024x1024 图像拖到应用商店 iOS 1024pt 插槽的井中,您认为这会起作用。但我在存档并提交给商店后仍然收到拒绝的电子邮件。

Missing Info.plist value - A value for the Info.plist key CFBundleIconName is missing in the bundle. bla bla bla...

缺少 Info.plist 值 - 包中缺少 Info.plist 键 CFBundleIconName 的值。bla bla bla...

I also had added the key to the Info.plist for "Icon Name" which is also known by CFBundleIconName and set it to a string filename that matched my 1024x1024 image in the project. But none of that worked even though checking the IPA contents showed everything correctly in place.

我还在 Info.plist 中添加了“图标名称”的键,它也被 CFBundleIconName 知道,并将其设置为与我在项目中的 1024x1024 图像匹配的字符串文件名。但是,即使检查 IPA 内容显示所有内容都正确到位,这些都不起作用。

finally I deleted the AppIcon from my catalog called Assets.xcassets so that it was empty and did the following to fix the issue:

最后,我从名为 Assets.xcassets 的目录中删除了 AppIcon,使其为空,并执行以下操作来解决该问题:

Go to the main setting for the app by clicking your app name and then selecting the GENERAL tab then under App Icons and Launch Images section click the button beside App Icons source and choose to use an asset catalog - select the name of your asset catalog - mine was called Assets.xcassets - and say to convert (migrate) the app with the button on that popup - I also checked the box to convert launch images too - when you are done the App Icons Source and the Launch Images Source will have names in the dropdown list.

单击您的应用程序名称,然后选择“通用”选项卡,然后在“应用程序图标和启动图像”部分下单击“应用程序图标”源旁边的按钮并选择使用资产目录,以转到应用程序的主要设置 - 选择您的资产目录的名称 -我的名为 Assets.xcassets - 并说使用该弹出窗口上的按钮转换(迁移)应用程序 - 我还选中了转换启动图像的框 - 完成后,应用程序图标源和启动图像源将具有名称在下拉列表中。

go to the asset catalog by clicking on it - again mine was Assets.xcassets and then click on the AppIcon section and drag your 1024x1024 image into the App Store iOS 1024pt well / slot. archive your app one last time and submit it to the app store - at that point hopefully won't get anymore emails from hell as I started calling them about rejection of your app and you can return to iTunesConnect to submit your app.

单击它转到资产目录 - 我的还是 Assets.xcassets,然后单击 AppIcon 部分并将您的 1024x1024 图像拖到 App Store iOS 1024pt well/slot 中。最后一次归档您的应用程序并将其提交到应用程序商店 - 那时希望不会再收到来自地狱的电子邮件,因为我开始打电话给他们关于拒绝您的应用程序,您可以返回到 iTunesConnect 提交您的应用程序。

Good luck - I empathize with the pain you might be feeling with this mostly cryptic error when you have tried lots of reasonable fixes that just didn't pan out. Such is the life of a software engineer sometimes... ;)

祝你好运 - 当你尝试了很多合理的修复但没有成功时,我理解你可能会因为这个几乎是神秘的错误而感到的痛苦。有时这就是软件工程师的生活......;)

if it was easy everyone would do it, right. ;)

如果这很容易,每个人都会这样做,对。;)

回答by Guru

Simplest solution is to add CFBundleIconName key in plist and fill all AppIcon slices in assets catalog.

最简单的解决方案是在 plist 中添加 CFBundleIconName 键并填充资产目录中的所有 AppIcon 切片。

Info.plist :

信息.plist :

<key>CFBundleIconName</key>
<string>AppIcon</string>

enter image description here

在此处输入图片说明

enter image description here

在此处输入图片说明

Download Working AppIcons Assets Here

在此处下载工作 AppIcons 资产

回答by GlennRay

I was getting the same email whenever I submitted a binary for a new version of one of my apps. I tried all the remedies listed here, but nothing worked. Then I made one more change that worked.

每当我为我的一个应用程序的新版本提交二进制文件时,我都会收到相同的电子邮件。我尝试了这里列出的所有补救措施,但没有任何效果。然后我又做了一个有效的改变。

In the Target . . . Build Settings . . . Asset Catalog Compiler - Optionssection, make sure the name of the asset catalog that contains the icons is shown in Asset Catalog App Icon Set Name. For some reason, my Asset Catalog App Icon Set Namewas blank.

目标 . . . 构建设置。. . Asset Catalog Compiler - Options部分,确保包含图标的资产目录的名称显示在 Asset Catalog App Icon Set Name 中。出于某种原因,我的资产目录应用程序图标集名称为空。

回答by Neha Vipin

Apps built with iOS 11 or later SDK must supply app icons in an asset catalog and must also provide a value for this Info.plist key

使用 iOS 11 或更高版本 SDK 构建的应用程序必须在资产目录中提供应用程序图标,并且还必须为此 Info.plist 键提供值

For older projects without assets catalog there will be issues while submitting to Appstore

对于没有资产目录的旧项目,提交到 Appstore 时会出现问题

In Project —> Target Properties - General tab—> App Icons and Launch Image. App Icons —> Select Use Asset catalog Then it will ask to convert (migrate) with an alert and creates a .xcassets file. Check the box to convert launch images too.
When you are done the App Icons Source and the Launch Images Source will have names in the dropdown list. Add the app icons and other icons to it

在项目 -> 目标属性 - 常规选项卡 -> 应用程序图标和启动图像。App Icons —> 选择 Use Asset catalog 然后它会提示转换(迁移)并创建一个 .xcassets 文件。选中该框也可以转换启动图像。
完成后,App Icons Source 和 Launch Images Source 将在下拉列表中显示名称。向其中添加应用程序图标和其他图标

回答by Neha Vipin

Now in IOS 11, we need to add a new icon in our project of size 1024x1024.

现在在 IOS 11 中,我们需要在我们的项目中添加一个大小为 1024x1024 的新图标。

Ensure that the Icon files are removed from resources folder in source code bundle and also Icons files key in info.plist is cleared. Also add CFBundleIconName key in plist as below

确保从源代码包中的资源文件夹中删除图标文件,并清除 info.plist 中的图标文件键。还要在 plist 中添加 CFBundleIconName 键,如下所示

Info.plist :

信息.plist :

<key>CFBundleIconName</key>
<string>AppIcon</string>

Also in the Project - Target—>Build Settings —> Asset Catalog Compiler - section, make sure the name of the asset catalog that contains the icons is shown in Asset Catalog App Icon Set Name.

同样在项目 - 目标 -> 构建设置 -> 资产目录编译器 - 部分,确保包含图标的资产目录的名称显示在资产目录应用程序图标集名称中。

回答by casillas

I have got the same issue and solved it as follows.

我遇到了同样的问题,并按如下方式解决了它。

Here is the step by step guideline.

这是分步指南。

Step 1:

第1步:

Create an icon with 1024*1024.png

创建一个 1024*1024.png 的图标

Step 2:

第2步:

Upload this png to the https://www.appicon.build/website and drag and drop on screen.

将此 png 上传到https://www.appicon.build/网站并拖放到屏幕上。

enter image description here

在此处输入图片说明

Step 3:

第 3 步:

It will ask you to enter your email address. Enter it and then after few seconds, you will get all the required image sizes into your mailbox. Download that zipped folder and unzipped it.

它会要求您输入您的电子邮件地址。输入它,然后几秒钟后,您将获得所有需要的图像尺寸到您的邮箱中。下载该压缩文件夹并将其解压缩。

Step 4:

第四步:

Go back to your project on Xcodeand add this unzipped folder(called AppIcon.appconset) into the resources folder in your xcode project.

返回到您的项目Xcode并将此解压缩文件夹(称为 AppIcon.appconset)添加到您的 xcode 项目的资源文件夹中。

enter image description here

在此处输入图片说明

Step 5:

第 5 步:

Double click on Asset.xcassetsfolder and drag and drop required images on the image placeholder for 2x and 3x images from the generated images.

双击Asset.xcassets文件夹并将所需的图像拖放到图像占位符上,以从生成的图像中获取 2x 和 3x 图像。

enter image description here

在此处输入图片说明

You are good to go!...

你已准备好出发!...

回答by hisairnessag3

For anyone who the above answers did not help(spent a good bit of head-wall banging on this one):

对于上述答案没有帮助的任何人(在这个问题上花了很多时间):

Make sure to check the target membership of your assets directory! If you do not correctly link the membership here, you will get this same super-generic error(Apple should do something about the error messages).

确保检查资产目录的目标成员资格!如果您没有在此处正确链接成员资格,您将收到同样的超级通用错误(Apple 应该对错误消息做一些处理)。

enter image description here

在此处输入图片说明

The target membership should correlate directly to targets for which you are using the icons. For example, I use this single directory for both my main app, and watch app assets, you must specify this by selecting the appropriate member.

目标成员资格应与您使用图标的目标直接相关。例如,我将这个单一目录用于我的主应用程序和观看应用程序资产,您必须通过选择适当的成员来指定这一点。

You do not need to edit the plist at all, most of these answers are misleading.

您根本不需要编辑 plist,这些答案中的大多数都是误导性的。

Hope this helps someone who hits this!

希望这可以帮助遇到此问题的人!

回答by R. Bauer

I too have encountered the "Missing Info.plist value - A value for the Info.plist key CFBundleIconName is missing in the bundle..."error and wanted to leave a concise answer to hopefully help the next person.

我也遇到了“缺少 Info.plist 值 - 捆绑包中缺少 Info.plist 键 CFBundleIconName 的值...”错误,并希望留下一个简洁的答案,希望能帮助下一个人。

The app was not using an asset catalog. Although that is not what this error says, that is what is required to resolve this issue, but how you add the values is important. It is not enough to manually add this missing key\value to the .plist; there is more to it than that. You also need to remove the CFBundleIcons value from your .plist. This can be done manually, but I recommend using the XCode interface to edit this through the Project Properties - General App Icons and Launch Image. That is how I got mine to work.

该应用程序未使用资产目录。虽然这不是此错误所说的,但这是解决此问题所必需的,但如何添加值很重要。手动将这个缺失的键\值添加到 .plist 中是不够的;不仅如此。您还需要从 .plist 中删除 CFBundleIcons 值。这可以手动完成,但我建议使用 XCode 界面通过 Project Properties - General App Icons 和 Launch Image 进行编辑。这就是我如何让我的工作。

Below is a screen shot of the changes this made to my .plist.

下面是对我的 .plist 所做更改的屏幕截图。

Updated .PList

更新.PList

App Icons and Launch Images

应用程序图标和启动图像

Add a new Asset Catalog to your project if you do not already have one.
Click the app name at the top of your Navigator window
Select the GENERAL tab
Scroll down to the "App Icons and Launch Images" section
Click the "use an asset catalog" button
NOTE: I had created my own asset catalog and iOS App icon image set, but linking to the existing one didn't work for me as it created a new image set which had empty values\images. I had to delete them all and let this process create them for me. If you are just now adding an asset catalog to resolve this issue, let this process create it for you, don't manually add the image set.

如果您还没有一个新的资产目录,请添加到您的项目中。
单击导航器窗口顶部的应用程序名称
选择常规选项卡
向下滚动到“应用程序图标和启动图像”部分
单击“使用资产目录”按钮
注意:我已经创建了自己的资产目录和 iOS 应用程序图标图像设置,但链接到现有图像对我不起作用,因为它创建了一个具有空值\图像的新图像集。我不得不将它们全部删除,让这个过程为我创建它们。如果您刚刚添加资产目录来解决此问题,请让此过程为您创建它,不要手动添加图像集。

Click to convert\migrate the app
After clicking the button, nothing refreshed automatically for me. I navigated away and then back to the settings screen and values were now assigned in the dropdown list.

单击以转换\迁移应用程序
单击该按钮后,我没有自动刷新任何内容。我导航离开然后回到设置屏幕,现在在下拉列表中分配了值。

Now open your new asset catalog by clicking on it
Click on the "AppIcon" section and drag your required images to the appropriate locations.

现在通过单击打开您的新资产目录 单击
“AppIcon”部分并将所需的图像拖动到适当的位置。

You will need the 1024x1024 image for the App Store iOS 1024pt icon and any other iPhone\iPad\Universal app required icons. The 1024x1024px image is also known as the Marketing Icon. You cannot submit your app without it.

您将需要 1024x1024 图像作为 App Store iOS 1024pt 图标和任何其他 iPhone\iPad\Universal 应用程序所需的图标。1024x1024px 图像也称为营销图标。没有它,您将无法提交您的应用程序。

You should now be able to archive your app and submit it to the app store.

您现在应该能够归档您的应用程序并将其提交到应用程序商店。

回答by Pramod Chaudhari

Follow the steps below.

请按照以下步骤操作。

  1. In your Project add new file>>Asset Catlog.
  2. Goto Click on your project in XCODE>>General>>App Icons. See screenshot. This will create AppICon and LaunchImage Specifications automatically inside your Asset after that you can drag and drop your Appstore icon and other icons in it.

  3. Also Add
    <key>CFBundleIconName</key>
    <string>AppIcon</string>
    .

  1. 在您的项目中添加新文件>>资产目录。
  2. 转到在 XCODE>>General>>App Icons 中单击您的项目。见截图。这将在您的资产中自动创建 AppICon 和 LaunchImage 规范,之后您可以将 Appstore 图标和其他图标拖放到其中。

  3. 还添加.
    <key>CFBundleIconName</key>
    <string>AppIcon</string>

This entry in your plist file.

您的 plist 文件中的此条目。

Upload Your Binaries to Itunes.

将您的二进制文件上传到 Itunes。