错误:未发现的资源匹配给定名称(在“图标”,值为“@绘制/图标”) [英] Error : No resource found that matches the given name (at 'icon' with value '@drawable/icon')

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

问题描述

错误:未发现的资源匹配给定名称(在图标,值为@绘制/图标')

这是我的表现......我非常新的这个,刚开始今天上午,并没有previous编程经验。

 <舱单的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
包=com.asdf
安卓版code =1
机器人:VERSIONNAME =1.0>

<用途-SDK
    安卓的minSdkVersion =8
    机器人:targetSdkVersion =19/>

 <应用
    机器人:allowBackup =真
    机器人:图标=@可绘制/ ic_launcher
    机器人:标签=@字符串/ APP_NAME
    机器人:主题=@风格/ AppTheme>
 < /用途>
<应用机器人:标签=@字符串/ APP_NAME机器人:图标=@可绘制/图标>
<活动机器人:名称=为ExampleActivity
          机器人:标签=@字符串/ APP_NAME>
    <意向滤光器>
        <作用机器人:名称=android.intent.action.MAIN/>
        <类机器人:名称=android.intent.category.LAUNCHER/>
    &所述; /意图滤光器>
< /活性GT;
< /用途>

< /舱单>
 

解决方案

发现这个问题。我是导入旧项目到Android的工作室,并得到了错误。

这个问题最终回答了我在这里纹理映射可绘制的图标

在清单中有

 <应用
    机器人:allowBackup =真
    机器人:图标=@可绘制/ ic_launcher
...
 

但@drawable已取代了@mipmap因此需要更改为:

 <应用
    机器人:allowBackup =真
    机器人:图标=@纹理映射/ ic_launcher
...
 

我把这个答案在这里,因为它可能会成为一种较为普遍的问题。

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

This is my manifest... I'm extremely new to this, just started this morning and have no previous programming experience.

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.asdf"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="19" />

 <application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
 </application>
<application android:label="@string/app_name" android:icon="@drawable/icon">
<activity android:name="ExampleActivity"
          android:label="@string/app_name">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>
</application>

</manifest>

解决方案

Found this question. I was importing an old project into android studio and got the error.

The issue was eventually answered for me here mipmap drawables for icons

In the manifest it has

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
...

but @drawable has been superseded by @mipmap so needed changing to:

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
...

I put this answer here, as it may become a more common issue.

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

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