The r gets red when there is a problem generating this file. This can e. g. I would suggest to open a console in the path of your project and type:
R. java file contains the link between xml and java page. R cannot be resolved arise only if there is a problem with some of your resource files. So the best and effective way is delete the last done xml or drawable in res file.
If we have helped you in any way, kindly do share this on social media with your friends. Invalidate cache / restart. Masalah cannot resolve symbol r ini bisa juga terjadi setelah kita memindahkan file atau direktori java ke lokasi lain.
Klik menu file pada android studio. Lalu klik invalidate cache/ restart.