'R cannot be resolved to a variable' - gen folder is empty

前端 未结 14 2416
故里飘歌
故里飘歌 2021-02-13 22:34

I\'ve got an error:

R cannot be resolved to a variable

in line:

setContentView(R.layout.main);

but I can\'t r

14条回答
  •  南笙
    南笙 (楼主)
    2021-02-13 23:06

    Clean your project once. It should build that file again automatically. Go to Project->Clean Of course, it will work ony if your xml files are syntactically correct!

提交回复
热议问题