Maiden Taief
Maiden Taief

Reputation: 1

Android Studio R is error

How can I fix the R. problem in android studio.

getMenuInflater().inflate(R.menu.menu_game, menu);

Here an error is occurring and it's showing that R can't resolve

Upvotes: 0

Views: 430

Answers (2)

Samuele Pontremoli
Samuele Pontremoli

Reputation: 594

You have an issue inyour .xml, post it if you cannot identify the issue. Then do a clean/rebuild project. R will be regenerated if your layout is correct.

Upvotes: 0

asozcan
asozcan

Reputation: 1390

In your case, Android Studio cannot build R file because of an error in a resource file, like an unclosed xml tag. It can be any kind of xml file. Check your xml files which you edit last, menu_game for example.

Upvotes: 2

Related Questions