Reputation: 20289
For app icons we should use the mipmap
folder. Now I added the following folders to the Resources
folder:
In each of these folders there is a ic_launcher.png
for the app icon and the build action is AndroidResource
.
Now I can't set the Application Icon
in the Android Manifest
. It doesn't appear there. What I'm missing?
I deleted the default icon in the drawable
folder and removed the entry in Android Manifest
. On build I got
No resource found that matches the given name (at 'icon' with value '@drawable/icon').
File: ...\SomeApp.Droid\obj\Debug\android\manifest\AndroidManifest.xml
There was an entry in MainActivity
which was the old reference to Icon = @drawable/icon
. Now I changed to Icon = @mipmap/ic_launcher
and the error was gone.
Upvotes: 8
Views: 10669
Reputation: 10296
No resource found that matches the given name (at 'icon' with value '@mipmap/CircleIcon')
In my case my icon name is "CircleIcon.png".
I fixed this issue by doing the following:
Change MainActivity
to this:
[Activity(
Label = "Appname",
Icon = "@mipmap/icon",
Theme = "@style/MainTheme" /*"@android:style/Theme.Material.Light" */,
Exported = true,
LaunchMode = LaunchMode.SingleTask,
MainLauncher = true,
ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation,
HardwareAccelerated = true,
ScreenOrientation = ScreenOrientation.Portrait)]
Clean solution space and rebuild.
Upvotes: 1
Reputation: 1664
Tried these:
Additionally:
What I had to do was add the folders and icons in manually (i.e. right-click > add > new folder
). I could not just drag and drop it in whereas doing so does not allow you to see the icon files inside folders either.
It seems the build action should automatically be set to newly added resources (ref). I'm not sure why a drag-and-drop to solution explorer would "hide" files in folders.
Upvotes: 1
Reputation: 20289
I manually edited the AndroidManifest.xml
to use the mipmap
folder:
<application android:label="@string/app_name" android:icon="@mipmap/ic_launcher"></application>
Upvotes: 6