I have updated SDK.R cannot be resolved to a variable

走远了吗. 提交于 2019-12-13 04:34:54

问题


I have updated SDK for the latest but still I am getting this error .R cannot be resolved to a variable. I know its not generating R.java. what should I do to resolve this issue.


回答1:


update your Platform-Tools and install Android Build tools too...

and restart your eclipse... hope this helps..
check here for more info..




回答2:


Assuming your Java code is correct, most likely your cause is an error in a resource or your AndroidManifest.xml file that is preventing R.java from being regenerated. To figure out what is going on:

  1. Look for red X marks in the Package Explorer for resources or the manifest
  2. Look in the Console for error messages
  3. Look in the Problems view for error messages

Refer this for other solutions: R cannot be resolved - Android error




回答3:


Delete R.java file from your source folder. Now Clean your project Click on Project >> Clean >> Clean Project selected below >> Select your project from list >> ok.

and also try this.

Right Click on your Projectname >> Android Tools >> Fix project Property



来源:https://stackoverflow.com/questions/17312509/i-have-updated-sdk-r-cannot-be-resolved-to-a-variable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!