Android Studio: “Cannot resolve symbol R” – what to do?

If you use Android Studio to develop or optimize apps, you may encounter the error “Cannot resolve symbol R”. But the software doesn’t explain what the red R in your project is all about.

That means the error “Cannot resolve symbol R”

If you get the error “Cannot resolve symbol R” in Android Studio and some Rs in your project are marked in red, this is often due to a coding error. So go through the lines again calmly and check whether all characters and references are correctly marked.If you don’t find a bug in your app , the problem can also be a bug. Fortunately, you can easily fix this.

How to fix Cannot resolve R in Android Studio

If you get the “Cannot resolve symbol R” error in Android Studio, try the following:

  1. Start Android Studio and open your project where the error occurs.
  2. Now click on “Build” at the top and then on “Clean Project”. The project is now being cleaned up.
  3. Then select the “Rebuild Project” action again under “Build”.
  4. Next, highlight one of the red Rs in your project and right click on it.
  5. Then select “Create class R” in the context menu.
  6. Then confirm the window that appears with “OK”.

If this doesn’t fix the error, reinstalling Android Studio can help in some cases .

Leave a Reply

Your email address will not be published. Required fields are marked *