找不到与给定名称匹配的资源(在'icon'处,值为'@ mipmap/ic_launcher.png')

dn_*_*n_c 3 android android-manifest

在此输入图像描述我在我的应用程序中更改了启动器图标.我添加的图像是PNG格式.但是当我清理并构建我的项目时,它会给出以下错误.

找不到与给定名称匹配的资源(在'icon'处,值为'@ mipmap/ic_launcher.png').

下面是我的AndroidManifest.xml

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
Run Code Online (Sandbox Code Playgroud)

Bla*_*elt 15

从中删除文件的扩展名 android:icon

改变

android:icon="@mipmap/ic_launcher.png"
Run Code Online (Sandbox Code Playgroud)

 android:icon="@mipmap/ic_launcher"
Run Code Online (Sandbox Code Playgroud)

请确保你ic_launcher.pngmipmap文件夹中

编辑:

从您发布的屏幕截图中看起来您正在编辑错误的清单文件.请务必编辑下的那个src/main/manifests

  • 你在res下添加了各种`mipmap-mdpi`,`mipmap-hdpi`文件夹吗? (3认同)
  • 对我来说这听起来更像是一个错误。 (2认同)
  • 你正在编辑wring AndroidManifest.xml.屏幕截图显示您正在编辑正在构建的那个 (2认同)