Problem resolved after changing the gradle version. Details history can be found here.
Now the point that comes here is how we can fix “cannot resolve symbol R” in Android Studio. So in this article, we are going to discuss six different methods to fix “cannot resolve symbol R” in Android Studio.
I was using gradle 3.3.0. It was the main culprit. Wasted 6.50 hours from my life. Gradle 3.2.1 removed the error.
classpath 'com.android.tools.build:gradle:3.2.1'
Problem resolved after changing the gradle version. Details history can be found here.