Reputation: 3
When I open My any Project in Android Studio The main problem is in setContentView(R.layout.activity_main)
. Here showing error of R
. When I use Rebuild Project the Problem is solved, but when I Run the project the same problem is appeared in the run time.
Upvotes: 0
Views: 2098
Reputation: 2927
Try the following:
R
class not found related issues are usually because of errors in the xml resources(layouts, drawables, etc). Fix them and then try running.cmd+shift+a
and search for gradle sync. Fix any errors that may popup.Upvotes: 1