Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: No resource found that matches the given name (at 'icon' with value '@mipmap/Icon')

This is my first attempt at Xamarin, just running through the examples at Xamarin.com.

But I'm getting this error when I try to build. It's strange because I can select the icon from the list on the properties tab but VS can't find them during the build.

I've tried moving the files so the path is really short.

I've tried adding new icons with differnt names and selecting them in the properties page.

Neither of these worked.

The AndroidManifest.xml file looks like this:

<?xml version="1.0" encoding="utf-8"?> 
  <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="Phoneword.Phoneword" android:versionCode="1" android:versionName="1.0" android:installLocation="auto">
    <!--suppress UsesMinSdkAttributes-->
    <uses-sdk android:minSdkVersion="21" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <application android:allowBackup="true" android:label="Phoneword" android:icon="@mipmap/Icon" android:name="android.app.Application" android:debuggable="true">
      <activity android:label="Phone Word" android:name="md5eb8cee9bb2852617ab2e56c7bf729ae8.MainActivity">
        <intent-filter>
          <action android:name="android.intent.action.MAIN" />
          <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
      </activity>
      <provider android:name="mono.MonoRuntimeProvider" android:exported="false" android:initOrder="2147483647" android:authorities="Phoneword.Phoneword.mono.MonoRuntimeProvider.__mono_init__" />
      <!--suppress ExportedReceiver-->
      <receiver android:name="mono.android.Seppuku">
        <intent-filter>
          <action android:name="mono.android.intent.action.SEPPUKU" />
          <category android:name="mono.android.intent.category.SEPPUKU.Phoneword.Phoneword" />
        </intent-filter>
      </receiver>
    </application>
  </manifest>
like image 231
CompanyDroneFromSector7G Avatar asked Nov 02 '17 22:11

CompanyDroneFromSector7G


2 Answers

Here's a workaround. Go into assemblyinfo.cs (it's in the Properties folder in your project) and add the following line in there:

[assembly: Application(Icon = "@mipmap/icon")]

like image 138
Clinton Avatar answered Oct 13 '22 08:10

Clinton


The solution:

  1. Change all "Icon.png" names into mipmap folders to "icon.png".
  2. Clean project
  3. Re-open Visual Studio
  4. Select "@mipmap/icon" in "Application Icon" in AndroidManifest.
like image 24
Ganesh Singh Avatar answered Oct 13 '22 08:10

Ganesh Singh