Icons, Asset Catalog and Confusion Info.plist

I have an application that started life for iOS 5 and has been updated ever since. For iOS 7, I switched to using the Asset Catalog for all resources, which is nice and seems to work well. However, when I try to introduce Apple, I get validation errors:

Invalid image path - no image was found in the path specified under the key "CFBundleIconFiles": " Icon@2x.png "

I get the same error for other icons. These icons appear in the Asset Catalog, and the names - right up to the case - match exactly as far as I can tell. The resource directory is in the Bundle Copy Resources section, and all resources appear in the right place when I launch the application on both my iPhone and iPad (in iOS 7) and in Simulator for iOS 6.

I updated the app to use the minimum deployment goal of iOS 6.

So, how do I successfully submit my Apple update? Do I need links in Info.plist? Are there any other settings I should check? Is the warning false and something that I should ignore (after raising the radar)?

+7
ios7 info.plist asset-catalog
source share
2 answers

When the resource catalog is compiled for iOS 6 and below, the images are placed in the root of the application package, as if you just copied them in the old way. When this happens, Apple names the images according to the asset name, not the file name, which means that we can still use +[UIImage imageNamed:] to get assets on iOS 6 and below.

This is true for the App Icon asset when the following icons are in our asset catalog:

enter image description here

They compile like this:

enter image description here

Since iOS 6 is still iOS 6, these files must be specified in Info.plist, otherwise the existing system will not work. If you look in the compiled Info.plist for this test application, you will see that Xcode has added CFBundleIconFiles for us, and therefore we don’t need to.

enter image description here

I downloaded the test project that I used for github.com/danielctull-tests/AssetTest .

+10
source share

Well, that’s what I ended up doing. I am not 100% sure, but I thought it was worth sharing.

  • I removed the CFBundleIconFile , which I think is not used in iOS 6 and above
  • I used the asset name, not the icon file name in CFBundleIconFiles

I don’t understand what names are needed for this, for clarity: by the name of the icon file, I mean the name visible in the Asset Catalog Attributes Inspector when the icon is selected; and by asset name, I mean AppIcon , which refers to the seven actual icons in my case.

This goes through Apple’s verification step, and it looks good. I currently do not have an iOS 6 device, but it displays correctly in the simulator.

+3
source share

All Articles