Solved! R.menu = unresolved reference

I’ve been stuck at this point for an entire day. I started this morning with my a lot of courage saying: I will make a simple app today and start learning android development. I went with kotlin btw.

But when trying to make a menu, I started getting stuck on inflating the menu as R.menu.main_menu just say’s that menu is an unresolved reference. So I thought, hmmm let’s try some other tutorials. Right now I know how to make menu’s (app bars or however they are called), but I just can’t display them! I have the path of res/menu/main_menu.xml, But it keeps being stubborn and not wanting to work because for some reason R can’t find menu!

I usually go to credit, but I can’t find any information about it either, searching on google doesn’t give me any results either on how to fix this. This is a brand new install of Android Studio.

Please, can somebody help me and explain what I’m doing wrong here so that I don’t make the same mistake again.

After I finally got a reply from my friend (we have 8 hours difference), he suggested to me to invalidate caches and restart. after this it finally worked. So basically because of 1 button that I failed to know about, I wasted near 7 hours today :c so far my android app building journey isn’t going as smooth as I had planned xc