The letter R stands for the Resource. This error occurs because of the incapability of the build process to Sync Resource files with your projects. Build your project once again. Sync your project with the Gradle Files. Usually, this happens because of the improper build of the project.
Android Studio cannot Resolve Symbol R, Can I Resolve This?Whenever you see this error after moving Java files or directories to other locations, then you can guarantee that Android Studio has gotten confused. And guess what? undoing those actions doesn't fix the problem.
- Looks project need to be cleaned by deleting the APK files first
- Do the project clean and again build the project
- If import android.R is present, it should be removed. At any cost, it should not have that because this is the default one. What is required is our project’s elements which are declared in XML file present under res folder. In case if we do not remove import android.R or when android studio automatically takes, there are cases of this error.
Hope this will solve your problem.