Xcode 4.3:在 Organizer 的档案中缺少 iOS 应用程序的图标

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

Xcode 4.3 : missing icons for iOS apps in Organizer's archives

iosxcodeiconsxcode4.3organizer

提问by Dirty Henry

Since upgrading to Xcode 4.3.x, my archives of iOS app in Organizer don't have an icon. (I have icons on my Mac OS X apps though)

自从升级到 Xcode 4.3.x 后,我在 Organizer 中的 iOS 应用程序档案没有图标。(虽然我的 Mac OS X 应用程序上有图标)

One app in particular is an iPad app for which i provided 2 icons (normal + retina sizes) but still, I don't get an icon for it in my archives.

特别是一个应用程序是 iPad 应用程序,我为它提供了 2 个图标(正常 + 视网膜大小),但我仍然没有在我的档案中找到它的图标。

xcode-select -print-pathreturns /Applications/Xcode.app/Contents/Developer(which I believe is the right setting as I want to have xcodebuild and xcron available in the terminal)

xcode-select -print-path返回/Applications/Xcode.app/Contents/Developer(我认为这是正确的设置,因为我希望在终端中使用 xcodebuild 和 xcron)

EDIT :

编辑 :

After investigation, I've found out that as of Xcode4.3.2, archives are using the first item of the CFBundleIconFiles embedded inside the iOS5 CFBundleIcons property to display, but it won't work if you keep a .png extension to your file.

经过调查,我发现从 Xcode4.3.2 开始,档案使用嵌入在 iOS5 CFBundleIcons 属性中的 CFBundleIconFiles 的第一项来显示,但如果您将 .png 扩展名保留到您的文件中,它将不起作用

1/ About what Apple's documentation says:

1/ 关于 Apple 的文档所说的内容:

When specifying icon files using the CFBundleIcons key, it is best to omit the filename extensions of your image files. If you include a filename extension, you must explicitly add the names of all image files (including any high-resolution variants). When you omit the filename extension, the system automatically detects high-resolution variants of your file, even if they are not included in the array.

使用 CFBundleIcons 键指定图标文件时,最好省略图像文件的文件扩展名。如果包含文件扩展名,则必须明确添加所有图像文件的名称(包括任何高分辨率变体)。当您省略文件扩展名时,系统会自动检测文件的高分辨率变体,即使它们未包含在数组中。

Given that you don't want to have file extensions to your icon files (cf. above), mentioning "ipad" only in your .plist when your archive actually contains "ipad" and "ipad@2x" won't work. I had to mention both in the .plist for the retina version to be actually used on a Retina device.

鉴于您不希望图标文件具有文件扩展名(参见上文),当您的存档实际上包含“ipad”和“ipad@2x”时,仅在 .plist 中提及“ipad”是行不通的。我不得不在 .plist 中提到要在 Retina 设备上实际使用的 Retina 版本。

BUT icons without .png extensions won't validate when you try to submit on the App Store. I'm fxxxed. Icons are making my life a nightmare right now.

但是,当您尝试在 App Store 上提交时,没有 .png 扩展名的图标将无法验证。我疯了。图标现在让我的生活成为一场噩梦。

2/ About TestFlight support of icons:

2/ 关于 TestFlight 对图标的支持:

TestFlight doesn't seem to support icon files without extension as I can't see my icons on this service now that I removed my files .png extension

TestFlight 似乎不支持没有扩展名的图标文件,因为我现在删除了我的文件 .png 扩展名后在此服务上看不到我的图标

回答by RMeijs

I had the exact same problem. Intrigued by your statement about xcode-selectI first tried:

我有同样的问题。对你关于xcode-select我第一次尝试的陈述很感兴趣:

xcode-select -print-path

Which resulted in:

这导致:

/Developer

Which is obviously wrong. So I first closed Xcode and then:

这显然是错误的。所以我首先关闭了 Xcode,然后:

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

After I restarted XCode all the icons were back in the Organiser.

在我重新启动 XCode 后,所有图标都回到了管理器中。

So thank you for pointing me in the right direction! But I realize it is probably not the solution for you. Hopefully others may benefit!

所以谢谢你给我指明了正确的方向!但我意识到这可能不是您的解决方案。希望其他人可以受益!

回答by jianghuan

Add iTunesArtwork in your info.plist's CFBundleIconFiles.

在 info.plist 的 CFBundleIconFiles 中添加 iTunesArtwork。

回答by Mick MacCallum

In your projects build phases turning off image compression solved this for me (it's either image or png compression, not at my computer to check) now this is a very strange situation because I haven't changed the way I format my images sense upgrading to 4.3 but during the app validation process I received an error telling me that my Icon.png wasn't 57x57 when it clearly was. I looked up how to solve this and turning off image compression was the fix... Which apparently made the icon show up in organizer too.... Weird.

在您的项目构建阶段,关闭图像压缩为我解决了这个问题(它是图像压缩或 png 压缩,而不是在我的电脑上检查)现在这是一个非常奇怪的情况,因为我没有改变我格式化图像的方式感觉升级到4.3 但在应用程序验证过程中,我收到一个错误,告诉我我的 Icon.png 不是 57x57,但它显然是。我查了一下如何解决这个问题,关闭图像压缩是解决办法......这显然使图标也出现在组织者中......很奇怪。

Good luck!

祝你好运!

回答by user739711

Check if the name of icon file is "Icon.png" .... not "icon.png" Not "ICON.PNG" not "icon.Png"

检查图标文件的名称是否为“Icon.png”......不是“icon.png”不是“ICON.PNG”不是“icon.Png”

回答by user739711

You may be mistaken on icon file name. Check if the name of icon file is "Icon.png" .... not "icon.png" Not "ICON.PNG" not "icon.Png". In my case it was "icon.png" I changed it to "Icon.png" and the problem got resolved.

您可能会误认为图标文件名。检查图标文件的名称是否是“Icon.png”....不是“icon.png”不是“ICON.PNG”不是“icon.Png”。就我而言,它是“icon.png”,我将其更改为“Icon.png”,问题得到解决。

回答by schmudu

I don't get it. However I'm running OS 10.8.2 and Xcode 4.5.2. At one point my app icon was working and somewhere along the way it vanished. I tried restarting, deleting derived data and nuthin.

我不明白。但是我运行的是 OS 10.8.2 和 Xcode 4.5.2。有一次,我的应用程序图标正在运行,但在途中的某个地方消失了。我尝试重新启动,删除派生数据和nuthin。

However I tried:

但是我试过:

  1. Copying the icon.iconset folder to my desktop.
  2. Deleting icon.iconset folder from Xcode
  3. Dragging the folder back into Xcode (copy files/folders enabled)
  4. Rebuild and voila! It showed up.
  1. 将 icon.iconset 文件夹复制到我的桌面。
  2. 从 Xcode 中删除 icon.iconset 文件夹
  3. 将文件夹拖回 Xcode(启用复制文件/文件夹)
  4. 重建,瞧!它出现了。

Magic I guess...

魔术我猜...