问题
Gradle build is not successful because it cannot find ic_launcher_foreground.xml in drawable.
回答1:
It is because you have accidentally deleted ic_launcher_forground
or it is missing due to some reason
Its genererally present in your drawable folder
A quick fix is you can add this file and rebuild your project again ic_launcher_forground
回答2:
If at all you delete the ic_launcher_foreground.xml
or ic_launcher_background.xml
files from your android project then no need to worry.
Simply,
- 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.
回答3:
Please check your drawable folder ic_launcher_forground file is missing
Rebuild your project again.
回答4:
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 todrawable
.
来源:https://stackoverflow.com/questions/49420636/drawable-ic-launcher-foreground-not-found-how-to-find-that-xml-file