R cannot be resolved to a variable

后端 未结 29 1062
不知归路
不知归路 2020-11-28 14:14

I would like to fix this error

R cannot be resolved to a variable

I looked up many answers, but I could not get the right one;

相关标签:
29条回答
  • 2020-11-28 15:12

    All the above suggestions should work normally, if you are still facing issue I suspect you are using 64bit OS and ADT is looking for 32bit binaries

    try executing below command in terminal and clean the project once

    sudo apt-get install ia32-libs
    
    0 讨论(0)
  • 2020-11-28 15:13

    I had this problem and turns out this was due to an error in one of my layout xml files that I had just changed

    0 讨论(0)
  • 2020-11-28 15:14
    1. check if files in res folder have any errors then
    2. Right click on project -> Android tools -> Fix project properties
    3. Project Clean
    0 讨论(0)
  • 2020-11-28 15:14

    i lived with this problem for 2 weeks and today i find the solution that is "icrease (MINIMUM SDK REQUIRED) to maximum possible"

    0 讨论(0)
  • 2020-11-28 15:15

    This error is because of deleting R.java file from project /gen folder. If you have backup of your project, please go to the project directory and paste R.java file which you copy from your backup section.

    Corrupt R.java file can also be caused by an error in XML. Often these kinds of errors don't show up in eclipse, so I'd suggest taking a look at your XML files. After that you can also try to Clean your project by going to Project -> Clean... in the menu bar.

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