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

前端 未结 14 2395
故里飘歌
故里飘歌 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:12

    I've had a similar problem. Tried everything and gen folder remained empty. It had to be with the SDK version 22. I hadn't installed the "Android SDK build-tools". I just had to install it with SDK Manager and restart Eclipse. As a member pointed on another post, the answer is better explained in this link: https://stackoverflow.com/a/16643060/1691231

    0 讨论(0)
  • 2021-02-13 23:16

    Delete your R.java fie and let it generate again...possibly this will help...i had same issue multiple times

    0 讨论(0)
提交回复
热议问题