Android studio not found R.id.****

时间:2015-06-15 15:02:12

标签: android android-layout android-studio

It has worked fine till now, but I apparently touched something and something happened.
Android Studio did not found R.id.**** and R.layout.****.

http://i.stack.imgur.com/EVZun.png

What do I need to do to resolve the problem?

5 个答案:

答案 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,它会解决这个问题。

enter image description here

答案 3 :(得分:0)

我认为由于某些错误,你的R.java没有正确构建。清理项目并检查重建项目时是否有错误。

答案 4 :(得分:0)

检查build.gradle(app)。如果页面顶部没有apply plugin: 'kotlin-android-extensions',请添加它。对我有用。

或键入ID 'kotlin-android-extensions'