Problem generating build in Xamarin Android (No Resource found that Matches the Given name "at 'icon' with value '@mipmap/icon')

Asked

Viewed 393 times

1

I am a designer trying to learn how to assemble screens for Android applications through Visual Studio, using Xamarin Android, so pretty beginner in technical terms related to the area...

I started by following the tutorials that Xamarin himself gives you, but basically none of them generates the build correctly, always presenting a random error. In this specific case, I want to seek solution to the problem that happens in this tutorial: https://developer.xamarin.com/guides/android/user_interface/designer_overview/designer_walkthrough/

I’ve followed the step-by-step a few times and it always gives error at build time. This last time, the error was this: (No Resource found that Matches the Given name "at 'icon' with value '@mipmap/icon')

Erro Xamarin Android

1 answer

1


I found a 'solution/gambiarra' that 'solves' the problem:

I went to Mainactivity.Cs and edited line 12 by clearing the reference on @mipmap/icon, leaving only this way:

[Activity(Label = "DesignerWalkthrough", MainLauncher = true)]

The point is: virtually all of Xamarin’s own tutorials contain some small problem so that prevents me from continuing testing. In this specific case, how could I run the build without having to delete the "Icon = "@mipmap/icon reference"?

UPDATE ------------>

Reading a little more, I understood that the error is in the icon image reference. I had read in another topic that calling Resources via drawable was old-fashioned and that the error could be linked to this: I should switch to mipmap. However, in this particular case I followed the reverse line and switched the mipmap to drawable in the reference and the app ran normally. My line went like this:

[Activity(Label = "DesignerWalkthrough", MainLauncher = true, Icon = "@drawable/Icon")]

Browser other questions tagged

You are not signed in. Login or sign up in order to post.