7

I have a problem when using RC1 of MAUI that caused me to remove this part from the Android manifest:

    <application
      ...
      android:icon="@mipmap/appicon" 
      android:roundIcon="@mipmap/appicon_round"
      ...>
    </application>

Now that it has GA'd, I'm trying to add it back in because in Android my application icon is not displayed - instead it's just the generic Android icon. When I add this back into my Android manifest like so:

    <application android:allowBackup="true"
      android:supportsRtl="true"
      android:icon="@mipmap/appicon" 
      android:roundIcon="@mipmap/appicon_round">
    </application>

I get compile errors that I have no idea how to resolve. NOTE: I DO have a file called "appicon.png", and it DOES work correctly as the application icon on iOS. The errors look like this:

APT2260 resource xml/microsoft_maui_essentials_fileprovider_file_paths (aka com.watchlikes.watchlikesapp:xml/microsoft_maui_essentials_fileprovider_file_paths) not found.

APT2260 resource style/Maui.SplashTheme (aka com.watchlikes.watchlikesapp:style/Maui.SplashTheme) not found.

APT2067 failed processing manifest.

If I take the android:icon and android:roundIcon attributes out of the manifest file it compiles correctly again. Any idea on what this problem is, and/or how to troubleshoot it?

Gerald Versluis
  • 30,492
  • 6
  • 73
  • 100
Steve Peschka
  • 1,015
  • 11
  • 25
  • I submitted an edit suggestion to improve readability and add some tags. I hope it improves the post! – JumperBot_ Jul 05 '22 at 02:28
  • I just re-read the compile errors, and it seems like you're missing some built-in features that allows custom resources in a specific directory to be used. Maybe give us the whole block of compile errors to give us a better insight? – JumperBot_ Jul 05 '22 at 04:02
  • When odd errors crop up after updating to new version, and messing with details such as this, sometimes its easiest to create a brand new project, and copy your source files over. It might "just work". Then if you really care, you can go back and identify what is different. – ToolmakerSteve Jul 05 '22 at 05:04
  • Point taken ToolmakerSteve. I did that today and I can at least compile again. Apparently though there are a number of issues getting the app icon right in Android apps right now (https://github.com/dotnet/maui/issues/4340 and https://github.com/dotnet/maui/issues/5652 for starters) and so I guess it's time to move onto something else and wait for a fix. Thank you. – Steve Peschka Jul 05 '22 at 23:52

1 Answers1

2

Had the same issue and followed https://learn.microsoft.com/en-us/dotnet/maui/user-interface/images/app-icons?tabs=android under "Platform-specific configuration":

If your icons name is "testicon.svg" just change the manifest file like this:

<application android:allowBackup="true"
  android:supportsRtl="true"
  android:icon="@mipmap/testicon" 
  android:roundIcon="@mipmap/testicon_round">
</application>
Matthias
  • 31
  • 3