错误:找不到与给定名称匹配的资源(在“图标"处,值为“@mipmap/Icon") [英] Error: No resource found that matches the given name (at 'icon' with value '@mipmap/Icon')

查看:16
本文介绍了错误:找不到与给定名称匹配的资源(在“图标"处,值为“@mipmap/Icon")的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我第一次尝试 Xamarin,只是运行 Xamarin.com.

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

但是当我尝试构建时出现此错误.这很奇怪,因为我可以从属性选项卡上的列表中选择图标,但 VS 在构建过程中找不到它们.

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.

这些都不起作用.

AndroidManifest.xml 文件如下所示:

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>

推荐答案

这里有一个解决方法.进入 assemblyinfo.cs(它位于项目的 Properties 文件夹中)并在其中添加以下行:

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

[程序集:应用程序(图标 = @mipmap/icon")]

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

这篇关于错误:找不到与给定名称匹配的资源(在“图标"处,值为“@mipmap/Icon")的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆