Search code examples
buildmauibuild-errormultiplatform

Building Maui MS Tutorial App: Get error APT2260: resource mipmap/appicon and mipmap/appicon_round not found


Most of the posts I found related to this issue were created when Maui was still in beta.
This issue affected the Android build only! The iOS build worked the first time.

Following this Microsoft Maui tutorial, I experienced a build issue right out the gate. The error was APT2260: resource mipmap/appicon and mipmap/appicon_round not found.

In the resources folder there was no appicon_round.svg file, so I copied appicon.svg to appicon_round.svg and tried a rebuild and got the same error.

I deleted android:roundIcon="@mipmap/appicon_round" from AndroidManifest.xml, and deleted the appicon_round.svg file I created via a copy action, but the build still failed.

Even though appicon.svg did exist, I removed android:icon="@mipmap/appicon" from AndroidManifest.xml, and the rebuild was successful. 🤦🏻‍♂️

Finally, I used Inkscape to create appicon_round.svg, I added it to the projects Resources/AppIcon folder, and then added android:icon="@mipmap/appicon" android:roundIcon="@mipmap/appicon_round" back to the AndroidManifest.xml file. The following build was successful.

First thing to note is that, while Visual Studio 2022 for MacOS did create the appicon.svg file, it did not generate the appicon_round.svg when I created the Multi-Platform project.

The second "gotcha" for me was when I removed the round SVG reference from the Android manifest file, but the build still failed.


Solution

  • To summarize how to resolved the issue, if you generate a multi-platform project in Visual Studio 2022 for MacOS and any AppIcon SVG files are missing ...

    1. Remove both/all AppIcon references from the AndroidManifest.xml
    2. Build the app.
    3. Generate the missing AppIcon SVG file(s) and put them in the correct folder.
    4. Add both/all AppIcon references back to the AndroidManifest.xml
    5. Build the app.