Missing AppIcon in Organiser

前端 未结 3 711
忘掉有多难
忘掉有多难 2021-02-07 13:07

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 O

相关标签:
3条回答
  • 2021-02-07 13:55

    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:

    plist entry

    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.

    0 讨论(0)
  • 2021-02-07 14:01

    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:

    • it hides the visual editing of former CFBundleIcons from General project settings. Why would you need it when you already opted in for the shiny new Asset Catalog, right?
    • it does not remove the original 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 iOS5
    • it does not validate the said key either. No little red crossmarks anywhere, because the project settings UI which could display them, is not visible anymore

    The 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.

    0 讨论(0)
  • 2021-02-07 14:03

    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]
    • AppIcon57x57@2x.png (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>AppIcon57x57@2x.png</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) - Dictionary
    • Primary Icon - Dictionary
    • Icon files - Array
    • Item 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.

    Do not add the following to any .plist: Just an example of what Xcode will now generate for your final payload

    <key>IconPaths</key>
    <array>
        <string>Applications/Example.app/AppIcon57x57.png</string>
        <string>Applications/Example.app/AppIcon57x57@2x.png</string>
        <string>Applications/Example.app/AppIcon72x72~ipad.png</string>
        <string>Applications/Example.app/AppIcon72x72@2x~ipad.png</string>
    </array>
    
    0 讨论(0)
提交回复
热议问题