Gradle build is not successful because it cannot find ic_launcher_foreground.xml in drawable.
If at all you delete the
ic_launcher_background.xml files from your android project then no need to worry.
- right click the drawable directory (inside res folder) and select New —> Image Asset. (2 above named files will automatically be generated with the ic_laucher)
- then click next and finally finish.
It is because you have accidentally deleted
ic_launcher_forground or it is missing due to some reason
A quick fix is you can add this file and rebuild your project again ic_launcher_forground
I had the same problem too and I solved it by:
- Make a new project or open an existing one
- Copy the XML file
ic_launcher_foreground.xml(v24) from that and paste it to
I had the problem and the file did exist.
I went into the file and formatted the contents (aka made a change), and that fixed the build system recognising the file.