I've recently migrated my application to support iOS7 and during that process updated my app icons to use an Asset Catalog; which is all working great in the app. However, in Organizer—and TestFlight—my app icon is missing.
The same is also happening in TestFlight—which implies there is something missing from my bundle. Any help would be gratefully received.
So it seems you still need to have the Icon files
entry in the app plist that points to an icon that is a resource in the app; even though Xcode removed this when I converted to the catalog; here is the entry that I created manually whilst also keeping the asset catalog:
Note that I have tested this with different icons and this setting does not impact the icons the App actually uses at runtime; this entry appears to only be used by Organizer and TestFlight, thereby solving my problem.
Yeah while using the Asset Catalog, you may need to do the following to get the App's Icon linked and working for Ad-Hoc distributions / production to be seen in Organiser, Test flight and possibly unknown AppStore locations.
After creating the Asset Catalog, take note of the name of the Launch Images and App Icon names listed in the .xassets
in Xcode.
By Default this should be
AppIcon
LaunchImage
[To see this click on your .xassets folder/icon in Xcode.] (this can be changed, so just take note of this variable for later)
What is created now each build is the following data structures in your .app:
For App Icons:
iPhone
AppIcon57x57.png
(iPhone non retina) [Notice the Icon name prefix][email protected]
(iPhone retina)And the same format for each of the other icon resolutions.
iPad
AppIcon72x72~ipad.png
(iPad non retina) AppIcon72x72@2x~ipad.png
(iPad retina)(For iPad it is slightly different postfix)
Main Problem
Now I noticed that in my Info.plist
in Xcode 5.0.1 it automatically attempted and failed to create a key for "Icon files (iOS 5)
" after completing the creation of the Asset Catalog.
If it did create a reference successfully / this may have been patched by Apple or just worked, then all you have to do is review the image names to validate the format listed above.
Final Solution:
Add the following key to you main .plist
I suggest you open your main .plist
with a external text editor such as TextWrangler rather than in Xcode to copy and paste the following key in.
<key>CFBundleIcons</key>
<dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>AppIcon57x57.png</string>
<string>[email protected]</string>
<string>AppIcon72x72~ipad.png</string>
<string>AppIcon72x72@2x~ipad.png</string>
</array>
</dict>
</dict>
Please Note I have only included my example resolutions, you will need to add them all.
If you want to add this Key in Xcode without an external editor, Use the following:
Icon files (iOS 5)
- DictionaryPrimary Icon
- DictionaryIcon files
- ArrayItem 0
- String = AppIcon57x57.png
And for each other item / app icon.Now when you finally archive your project the final .xcarchive payload .plist will now include the above stated icon locations to build and use.
<key>IconPaths</key>
<array>
<string>Applications/Example.app/AppIcon57x57.png</string>
<string>Applications/Example.app/[email protected]</string>
<string>Applications/Example.app/AppIcon72x72~ipad.png</string>
<string>Applications/Example.app/AppIcon72x72@2x~ipad.png</string>
</array>
Yet another possible hiccup with migrating to Asset Catalog.
There is two ways to define icons in project settings: CFBundleIconFiles
since iOS3 and CFBundleIcons
since iOS5. The older, despite being older, contrary to common sense about backward compatiblity, still takes precedence. I was using CFBundleIcons
before migrating directly to Asset Catalog. And after i migrated, i removed the original files pointed to by CFBundleIcons
because, you know, now i had the shiny new Asset Catalog, right? And XCode did three things:
CFBundleIcons
from General project settings. Why would you need it when you already opted in for the shiny new Asset Catalog, right?CFBundleIcons
key of Info.plist, though, by opting in for the Asset Catalog, you are saying clear and loud that you are not going below iOS5The result is hidden, visually noneditable, possibly outdated/wrong key in Info.plist
which takes precedence over what Asset Catalog created for you.
Go open your Info.plist
manually and delete CFBundleIcons
, rebuild, reupload, and voilà, icon is back.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With