I'm trying to add to mipmap in my app I have missing files/errors but it won't let me

523 Views Asked by At

I am trying to fix these errors which has caused the build to fail. But I am noticing in the newest version of Studio it wont let me add the image files to mipmap to fix the problem. What should I do?

enter image description here

2

There are 2 best solutions below

0
On

Your project doesn't build because in your XML file there is a ImageView with unrecognized image/source, @mipmap/ic_default_user. Thus, you must change the source image to one that the XML will recognize:

  • Instead of @mipmap/ic_default_user write some thing else. e.g @mipmap/ic_launcher or @mipmap/ic_launcher_round
  • You may see what images the XML recognize by writing "@mipmap/" and then press ctrl+space when you are in focus of "@mipmap/".
0
On
 <background android:drawable="@drawable/ic_launcher_background" />
    <foreground android:drawable="@drawable/ic_launcher_foreground" />

just put this in your file and it will work