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?
答案 0 :(得分:1)
我遇到了同样的错误,只是发现我自动导入了android.R
。我只需要删除它。
检查文件顶部是否有import android.R
。
答案 1 :(得分:0)
Try to undo(ctrl+z) whatever you did accidentally or go to build-> rebuild project. or build-> clean project or press ctrl+alt+y.
答案 2 :(得分:0)
resync gradle,它会解决这个问题。
答案 3 :(得分:0)
我认为由于某些错误,你的R.java没有正确构建。清理项目并检查重建项目时是否有错误。
答案 4 :(得分:0)
检查build.gradle(app)。如果页面顶部没有apply plugin: 'kotlin-android-extensions
',请添加它。对我有用。
或键入ID 'kotlin-android-extensions'
。