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

10

34

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.

Borzoi answered 1/12, 2022 at 18:22 Comment(0)
B
18

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.
Borzoi answered 1/12, 2022 at 18:22 Comment(3)
@AlexandarMay-MSFT, thanks and will do. But I have to wait 48 hours before I am able to accept my own answer. – Borzoi
I'm on 17.6.6 and this doesn't work for me – Sedation
using VS2022 17.9.7 this worked – Shockley
C
31

Sometimes I face the same build error while trying to deploy MAUI app to Android device in Release mode via Visual Studio for Mac.

The solution that works in my case is also simple:

  1. Manually delete project's bin and obj folders.
  2. Restart Visual Studio for Mac.
  3. Open app's project.
  4. Build -> Build solution.
Castled answered 8/3, 2023 at 4:6 Comment(6)
This works for Windows as well. Thanks. – Conan
Followed same steps, Worked. – Episcopacy
Just restarting IDE fixes this silly error inside JetBrains Rider too. – Evette
2024, still same issue. No code changes, just release from default project. Unbelievable. – Liverwort
This simple workaround work great - thanks! – Vinosity
Manually delete project's bin and obj folders and rebuild solution did the magic! I'm using VS for Windows. Thanks for sharing! – Gainless
S
24

I changed

<MauiIcon Include="Resources\AppIcon\appiconx.png" />

to a not existing file, build, get another error message, changed it back to the original filename and build again. No errors any more.
No choke! (VS 17.8.3, dotnet 8.0.100, target runtime net8.0)

Snowber answered 13/12, 2023 at 16:33 Comment(8)
Great workaround :) – Forging
This answer, nor any of the other solutions here worked for me and I'm using Visual Studio 2022 for Windows. I'm using an SVG for background and another SVG for the foreground. Both are SVG version 1.1. Nothing works. I'm completely stuck :( – Wearable
Despite does not make any sense, it works for me as well. – Liverwort
what a dumb workaround that works perfectly. Thanks Microsoft – Outdo
It is indeed unbelievable and I really didn't want to believe it myself, but now I have tried it and it really works! It seems to be some volatility of Visual Studio (2022 Enterprise). Thanks for the tip! – Unconnected
This did work for me. Like @iPaul, I had two SVGs for foreground / background. – Salesmanship
wasted another 2 hours. nice – Lastditch
Six month later (VS 17.10.1, dotnet 8.0.300, release build): I've got the same error again after creating a new branch. And this helps again. – Snowber
B
18

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.
Borzoi answered 1/12, 2022 at 18:22 Comment(3)
@AlexandarMay-MSFT, thanks and will do. But I have to wait 48 hours before I am able to accept my own answer. – Borzoi
I'm on 17.6.6 and this doesn't work for me – Sedation
using VS2022 17.9.7 this worked – Shockley
F
2

After updating net7-android to net8-android I started getting the same error. After I updated the nuget packages Microsoft.Maui.Controls and Microsoft.Maui.Controls.Compatibility to version 8.0.6, after which the build went without errors.

Perhaps removing these packages and reinstalling them with version 8.0.3 will help too. Because on my other computer this same project builds normally with versions 8.0.3.

P.S. before this I cleaned out the bin and obj folders

Faitour answered 18/1, 2024 at 12:38 Comment(1)
In my case clearing bin and obj folders was enough. – Chorister
A
2

The way that worked for me was to:

  1. Unistall the app on the target platform
  2. Clean the solution.
  3. Build the solution.

I saw that workaround here:

https://learn.microsoft.com/en-us/dotnet/maui/user-interface/images/app-icons?view=net-maui-8.0&tabs=windows

image from url link

Hope this could help.

Attempt answered 2/3, 2024 at 3:19 Comment(0)
A
1

Solution that worked for me was to clean all and then rebuild solution.

Antistrophe answered 22/4, 2024 at 14:0 Comment(0)
B
1

I use the JetBrains Rider IDE. My tried-and-true workaround is:

  1. Delete the android:icon="@mipmap/appicon" part from AndroidManifest.xml
  2. Rebuild Solution
  3. Add android:icon="@mipmap/appicon" back to AndroidManifest.xml
  4. Rebuild Solution again

This might work just as well in Visual Studio.

Burdock answered 28/6, 2024 at 15:43 Comment(0)
G
0

This issue is sure in new created project.

It resolve this "missing file reference" rename example "dotnet_bot.svg" -> to appicon.svg

  • and now it works and can be build without errors

My solution it works - image

Code:

<ItemGroup>
    <!-- App Icon -->
    <MauiIcon Include="Resources\AppIcon\appicon.svg" Color="#FFFFFF" ForegroundScale="0.5" />
    <!-- Images -->
    <MauiImage Include="Resources\Images\*" />
    <MauiImage Update="Resources\Images\dotnet_bot.svg" BaseSize="168,208" />
    <MauiImage Update="Resources\Images\appicon.svg" />
    <!-- Custom Fonts -->
    <MauiFont Include="Resources\Fonts\*" />
Goosy answered 1/11, 2023 at 15:8 Comment(0)
M
0

First of all: do not touch AndroidManifest.xml, it is not needed. The problem was in my project file, I had the comment <!-- App Icon --> but nothing under it.

So, fill your icon information under it:

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

Be sure it is inside a <ItemGroup></ItemGroup>

Then you have to clear and build your solution and uninstall the app in the mobile device and install it again.

Melano answered 10/11, 2023 at 8:19 Comment(0)
R
0

This is still happening for me, every time I delete bin/obj and clean the solution (which is many times per day, of necessity).

When that happens, I get around it by NOT closing the solution, NOT deleting bin/obj at the same time, and immediately cleaning the solution then rebuilding.

Rosebud answered 13/7, 2024 at 10:25 Comment(0)

© 2022 - 2025 β€” McMap. All rights reserved.