Reputation: 16186
I have wasted now 3 days triying to put the icon on the app.
I use https://makeappicon.com/ and download the files. Replace the AppIcon.appiconset folder. It not work.
I try everything I found, including cleaning, erasing emulator, erasing vs caches, and finally a full clean reinstalling of everything with the Visual Studio Mac installer.
Still the same.
I create a new black project and add the icons.
Still the same.
Finally I create a xcode project, do the same and it work at first try.
Also, I remove the AppIcon in the asset, manually create it again and manually set the icons.
I have in the .fsproj:
<ItemGroup>
<Folder Include="Data\" />
<Folder Include="App\img\" />
<Folder Include="App\img\provemax\" />
<Folder Include="Assets.xcassets\AppIcon.appiconset\" />
</ItemGroup>
<ImageAsset Include="Assets.xcassets\Contents.json" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Contents.json" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon-App-20x20%401x.png" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\ItunesArtwork%402x.png" />
P.D: I also create a empty project in C#, same result, link here:
Upvotes: 2
Views: 2915
Reputation: 16186
I ask in the VS community and was given a solution by Phil Mitchell :
https://developercommunity.visualstudio.com/content/problem/398309/icon-not-show-on-ios.html
Did you check the build warnings when you compiled the app. You should see a bunch of warnings about missing .png files in the AppIcon image set.
Unlike Xcode, VS requires a reference to each iOS asset .png file in the .csproj file as well as the Assets.xcassets Contents.json file. It's redundant; but it's just how VS works.
If you drag each .png file from Finder to the AppIcon viewer in VS it will add the .csproj reference, the warnings should go away and the icons should appear on the devices.
Upvotes: 4
Reputation: 38563
You are missing the enclosing around your assets:
<ItemGroup>
<Folder Include="Data\" />
<Folder Include="App\img\" />
<Folder Include="App\img\provemax\" />
<Folder Include="Assets.xcassets\AppIcon.appiconset\" />
</ItemGroup>
<ItemGroup>
<ImageAsset Include="Assets.xcassets\Contents.json" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Contents.json" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon-App-20x20%401x.png" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\ItunesArtwork%402x.png" />
</ItemGroup>
Upvotes: 2