I'm trying to add an icon to the Xamarin iOS app using Assets.xcassets and also I tried adding an .ico to the manifest in the iOS project settings but it doesn't work because I have the default Xamarin icon:
I don't have any particular error message referring to missing images or anything else in the build windows, debug or in the xamarin logs (Help/Xamarin/open logs).
I also tried to modify the Info.plist file:
<key>XSAppIconAssets</key>
<string>Assets.xcassets/AppIcon.appiconset</string>
<key>UIMainStoryboardFile</key>
<string>LaunchScreen</string>
<key>CFBundleIconName</key>
<string>AppIcon</string>
<key>CFBundleIcons</key>
<dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>20.png</string>
<string>29.png</string>
<string>40.png</string>
<string>401.png</string>
<string>402.png</string>
<string>58.png</string>
<string>581.png</string>
<string>60.png</string>
<string>76.png</string>
<string>80.png</string>
<string>801.png</string>
<string>87.png</string>
<string>120.png</string>
<string>1201.png</string>
<string>152.png</string>
<string>167.png</string>
<string>180.png</string>
<string>1024.png</string>
</array>
</dict>
</dict>
<key>CFBundleIcons~ipad</key>
<dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>20.png</string>
<string>29.png</string>
<string>40.png</string>
<string>401.png</string>
<string>402.png</string>
<string>58.png</string>
<string>581.png</string>
<string>60.png</string>
<string>76.png</string>
<string>80.png</string>
<string>801.png</string>
<string>87.png</string>
<string>120.png</string>
<string>1201.png</string>
<string>152.png</string>
<string>167.png</string>
<string>180.png</string>
<string>1024.png</string>
</array>
</dict>
</dict>
And there I have no icon at all.
What am I doing wrong?
I am using Visual Studio 2022 v17.4.1 (Windows)
steps to reproduce the error :
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\1024.png">
<Visible>false</Visible>
</ImageAsset>
I expect my application icon to appear on the phone
You don't need to modify the Info.plist file, you can refer to the following steps:
For more details, you can refer to the official documentation: Application Icons in Xamarin.iOS | Microsof
Update
According to the comments, you used Hot Restart. Hot Restart will have some restrictions, one of which is: Asset Catalogs are currently not supported. When using Hot Restart, your app will show the default icon and launch screen for Xamarin apps. When paired to a Mac, or developing on a Mac, your Asset Catalogs will work.