Android Error: package R does not exist
In Android application, R class is auto-generated by XML files. If there are error in your XML files in res directory, R class will not be created.
You need to check following files in your Android application.
1. Check for error in all your XML files in res directory such as layout, menu etc.
2. Check for error in AndroidManifest.xml
3. Check for correct package in build.gradle file. The namespace and applicationId should match your package.
If your package is com.example.myapp, the namespace and applicationId should be as following