Android新建项目报错android:icon="@drawable/ic_launcher"

Eclipse下创建了一个安卓应用
结果

/Users/123/Documents/workspace/Demo1/AndroidManifest.xml
.:11: error: Error: No resource found that matches the given name (at 'icon' with value '@drawable/ic_launcher').

说是改地址下没有匹配的引用名称。

报错

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

错误发生在

AndroidManifest.xml

中的

android:icon="@drawable/ic_launcher"

经查drawable文件夹下确实没有ic_launcher。
在minpmap文件夹下有ic_launcher。
这里写图片描述
看了网上许多网友反映的问题,应该是SDK升级之后出现的问题,估计是更改了原有的存放位置。
只要将代码

android:icon="@drawable/ic_launcher"

改为

android:icon="@mipmap/ic_launcher"

问题即可解决。

发布了83 篇原创文章 · 获赞 12 · 访问量 18万+

猜你喜欢

转载自blog.csdn.net/shengdaVolleyball/article/details/56673105