question

RonaldGANS-4488 avatar image
0 Votes"
RonaldGANS-4488 asked JarvanZhang-MSFT edited

resource mipmap/myicon not found. How to fix this?

I have a VS 2019 Xamarin app. It had previously compiled OK and was distributable.

The app's icon is poorly formed so I updated it.

But now when I rebuild I get the icon changed in the Manifest to android:icon="@mipmap/myicon" and that icon is not found so the build fails.

Even if I change the myicon reference, the build changes it back to myicon which I don't apparently have.

in the mipmap-anydpi-v26 folder i have:

ic_launcher.xml
ic_launcher_round.xml
icon.xml
icon_round.xml
myicon.xml

I'm just a lowly C# and assembler programmer. I find these references confusing.

How can I fix this?

RON

dotnet-xamarin
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AND WHEN I Change the myicon references to one that actually IS IN THAT FOLDER and recompile, SOME PROCESS changes the reference back to myicon and then it all fails. WHAT PROCESS DOES THAT AND WHY? NO IDEA.

Who creates apps which do these hidden weird things?

That crap.

Embarrassing.

0 Votes 0 ·

1 Answer

JarvanZhang-MSFT avatar image
0 Votes"
JarvanZhang-MSFT answered JarvanZhang-MSFT edited

Hello,​

Welcome to our Microsoft Q&A platform!

when I rebuild I get the icon changed in the Manifest to android:icon="@mipmap/myicon" and that icon is not found so the build fails.

The icon should be a picture instead of the xml file. The 'ic_launcher.xml' and 'ic_launcher_round.xml' are the configuration files.

<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
    <background android:drawable="@color/ic_launcher_background"/>
    <foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>

Please add the icon picture to the resource folder and then set the icon. You could specify the application icon through the Android Manifest section of project Properties. You can see the options that can be used to set the icon, this way can avoid the probem you encounter.

123021-image.png

For more details, you could refer to this doc:
https://docs.microsoft.com/en-us/xamarin/android/deploy-test/release-prep/?tabs=windows#Specify_the_Application_Icon

Best Regards,

Jarvan Zhang


If the response is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


image.png (46.0 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @RonaldGANS-4488
I have not heard from you for a couple of days. Please let me know if there is anything that I can help here.

0 Votes 0 ·