drawable/ic_launcher_foreground not found. How to find that xml file

…衆ロ難τιáo~ 提交于 2019-12-10 21:51:48

问题


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,

  1. 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)
  2. 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:

  1. Make a new project or open an existing one
  2. Copy the XML file ic_launcher_foreground.xml (v24) from that and paste it to drawable.


来源:https://stackoverflow.com/questions/49420636/drawable-ic-launcher-foreground-not-found-how-to-find-that-xml-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!