Forum Xamarin.iOS

Workaround for the iOS app icon not appearing bug

As reported multiple times in this forum and stackoverflow, the current version of Xamarin does not handle correcly app icons for iOS apps.
The issue is that Media assets are not created in the right location (outside the Resources folder contrary to the reference in info.plist: string>Resources/Media.xcassets/AppIcons.appiconset).

Fixing the path in info.plist does not work (Visual overwrites the modification).

The following assumes you are using Visual Studio (tested on Visual Studio 2017 v15.6.6).

Step 1: Revert to Resources based icons

Skip this step if you have not enabled the "Use Asset Catalog" in info.plist editor.

  • Close your solution
  • Open MyProject/MyProject/MyProject.iOS/info.plist in a text editor
  • Remove the following lines:

    <key>XSLaunchImageAssets</key>
    <string>Resources/Media.xcassets/LaunchImages.launchimage</string>
    <key>XSAppIconAssets</key>
    <string>Resources/Media.xcassets/AppIcons.appiconset</string>
    
  • Open solution

  • Right-Click Asset Catalogs > Media and select delete
  • Delete the MyProject/MyProject/MyProject.iOS/Media.xcassets

Step 2: Create the icons files with the right names

As of April 2018, the icons for an universal app (iPhone and iPad) supporting iOS 6.1+ are:
See: https: //developer.apple.com/library/content/qa/qa1686/_index.html

120x120 [email protected]
180x180 [email protected]
76x76   Icon-76.png
152x152 [email protected]
167x167 [email protected]
40x40   Icon-Small-40.png
80x80   [email protected]
120x120 [email protected]
29x29   Icon-Small.png
58x58   [email protected]
87x87   [email protected]

See Bonus below to automatically generates these files in Photoshop!

Step 3: add the icons in Resources

Your application should now show the correct icon. Modifiyng info.plist options in Visual does not seems to affect the icon list.

Bonus

Automatically create the icon files in Photoshop with the right sizes and file names:

  • Create a new Layer Group containing your icon artwork
  • Set the name of the Layer Group as follow:
    80x80 ios/[email protected],120x120 ios/[email protected],29x29 ios/Icon-Small.png, and so on...

  • Select File > Generate > Image Assets

  • Save

Photoshop automatically save the icon files.

Warning: the length of the Layer Group name must be less than 256. Create a second Layer Group if needed.

More info: https: //helpx.adobe.com/photoshop/using/generate-assets-layers.html

Posts

  • This works very nicely. Thank you! The only issue I have is that it shows the icon on the splash screen and I'm not sure how to change that. If you would include that in this post, it would make it perfect.

  • Suresh.9886Suresh.9886 USMember ✭✭

    it works well, thanks

  • BillyMartinBillyMartin USMember ✭✭✭

    Well, you're solution got me farther than I was, allowing me to upload, but then Apple sent me an email saying:

    Missing Info.plist value - A value for the Info.plist key 'CFBundleIconName' is missing. 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. For more information see

    help.apple.com/xcode/mac/current/#/dev10510b1f7

    Any ideas?

  • XusanRahimovXusanRahimov USMember ✭✭

    Hi

    In my case Assets.xcassets was created in root of project but path for it in info.plist was wrong so I changed it to correct path.

    Changed from this
    XSAppIconAssets
    Resources/Assets.xcassets/AppIcon.appiconset

    To this
    XSAppIconAssets
    Assets.xcassets/AppIcon.appiconset

  • MOFADevsMOFADevs QAUniversity ✭✭

    @BillyMartin said:
    Well, you're solution got me farther than I was, allowing me to upload, but then Apple sent me an email saying:

    Missing Info.plist value - A value for the Info.plist key 'CFBundleIconName' is missing. 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. For more information see

    help.apple.com/xcode/mac/current/#/dev10510b1f7

    Any ideas?

    Hi Billy Martin
    As per updated policy by Apple, you have to submit your icons as Assets, so you can't escape that, I am afraid. I had to do completely opposite what @AntonieClappier has suggested. Put your App Icons in an Asset Catalog and move the physical folder of Assets into Resources, update the pats in .csproj file of ios and try your luck.

  • craig_hoycraig_hoy Member ✭✭

    The solution that worked for me was to go to the \Assets.xcassets\AppIcon.appiconset folder and replace the default Xamarin icons with an icon of yours with the same dimensions and name but I did not move the folder (directory). Once the build has run you will notice that the Apple named files will show up properly.

Sign In or Register to comment.