R cannot be resolved to a variable

后端 未结 29 1189
不知归路
不知归路 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 14:53

    If you haven't yet, try cleaning your project as already suggested. In Eclipse Indigo, this is Project -> Clean... -> (Make sure your project(s) are checked) -> OK. After that, right click on your project and choose "Refresh".

    If this is still a issue, a few questions:

    1. Did you recently change the package name of your application in AndroidManifest.xml?
    2. Does the 'activity' node in your AndroidManifest.xml describing the class "Convert" specify a package/name that cannot be resolved naturally with that of your application? As an example, if your application is com.foo.bar and your activity is described as com.foobar.Convert, R.* will not automagically function -- you would need to explicitly include R for the proper package.

提交回复
热议问题