Reputation: 399
It has worked fine till now, but I apparently touched something and something happened.
Android Studio did not found R.id.**** and R.layout.****.
What do I need to do to resolve the problem?
Upvotes: 6
Views: 9650
Reputation: 11
You may import android.R at the top of your activity and use it in a command. Clear this import and use android.R.*** in that command and you can see R.layout.*** and R.id.*** in other commands can work.
Upvotes: 0
Reputation: 71
check build.gradle(app). if there is not apply plugin: 'kotlin-android-extensions
' on top of page include it. That works for me.
or type id 'kotlin-android-extensions'
instead.
Upvotes: 2
Reputation: 2268
I got the same error and just found out I imported automatically android.R
. I just had to remove it.
Check if you have import android.R
at the top of your file.
Upvotes: 17
Reputation: 2128
I Think Your R.java is not getting build properly due to some error. Clean your project and Check if there is some error while rebuilding the project.
Upvotes: 0
Reputation:
Try to undo(ctrl+z) whatever you did accidentally or go to build-> rebuild project. or build-> clean project or press ctrl+alt+y.
Upvotes: 0