Reputation: 2052
Im new to Visual Studio 2017 with Xamarin and created a App with a Webview in it. My script works when I test it on my device but I just cant add in Icon to it!
I read a lot about it and spend hours trying! I figured out i had to add the Icon to the assemblyInfo like this [assembly: Application(Icon = "@drawable/icon")]
After adding this I always get an Error:
Error: No resource found that matches the given name (at 'icon' with value '@drawable/icon'). Test ...\obj\Debug\android\manifest\AndroidManifest.xml 8
But i put an Image in my drawable folder (icon.png) ! I also cant see the icon on the sidebar in my Project folder in Visual Studio..
Some how I figured out that I can add the icon.png file to obj/Debug/res/drawable after I created the fodler drawable there and it will show the Icon on my Android BUT then my App doesnt work anymore -> Blackscreen and the App crashes.
Why is it so hard to add a god damn Icon? I also cant select any Icon in my Properties Tab like its shown in the Tutorial
The DropDown "Application Icon" is always empty no matter how I try to add my Icon. Thats how it looks on my screen: Picture of Properties
Please help me!
Upvotes: 2
Views: 1230
Reputation: 1418
Why don't you just do this on your first activity where MainLuncher is true
[Activity(Label = "MainActivity", MainLauncher = true, Icon = "@drawable/icon_you_want")]
public class MainActivity : AppCompatActivity
{
//...
}
And remove that [assembly: Application(Icon = "@drawable/icon")]
form AssemblyInfo.cs
The dropdown will still remain empty but you will see the image.
Upvotes: 1