0

because the MauiIcon ist not displaying my AppIcon for Android correctly, i want to manually change the AppIcon for Android with a PNG in the Android/Resources folder.

How can i get this to work, do i need to create a folder in Android / Resources? I use .net 7 and already tried to delete the bin, and clear the project etc. the icon is still not correctly display. In ios its working great but not in Android.

If you need furhter information just tell me. I am not getting this done till days

Pascal
  • 79
  • 1
  • 5
  • No. Whatever is the reason your icon is not displaying, work on that. What you are trying to do makes very little sense. – H.A.H. Jun 24 '23 at 21:12
  • 1) Your Android-specific attempt: Show in question exactly the steps you did. What files did you put where? What "build action" does your png have? What did you do to tell Android to use your png? 2) Standard cross-platform attempt: Did you follow doc instructions (not Android-specific) for changing Maui app icon? Again, what *exactly* did you do? – ToolmakerSteve Jun 24 '23 at 22:00

1 Answers1

0

You don't need to add an app icon separately on the Android platform.

In a .NET Multi-platform App UI (.NET MAUI) app project, an app icon can be specified in a single location in your app project. At build time, this icon can be automatically resized to the correct resolution for the target platform and device, and added to your app package. This avoids having to manually duplicate and name the app icon on a per platform basis.

In your project file, the <MauiIcon> item designates the icon to use for your app. You may only have one icon defined for your app. Any subsequent <MauiIcon> items are ignored.

The icon defined by your app can be composed of a single image, by specifying the file as the Include attribute:

<ItemGroup>
    <MauiIcon Include="Resources\AppIcon\appicon.svg" />
</ItemGroup>

For more information,you can check document: Change a .NET MAUI app icon.

Jessie Zhang -MSFT
  • 9,830
  • 1
  • 7
  • 19