Android R.java doesn't generate

最后都变了- 提交于 2019-12-12 11:48:27

问题


I've just updated the Android SDK to version 22.0 (well, more like a fresh install) and started a new project in Eclipse. I went through the project wizard and everything went fine but then I realised that it didn't generate the build files (neither BuildConfig.java nor R.java).

I searched a bit and found others with similar problems and someone pointed out that after updating a new package should be available called Android Build Tools. I had installed them as well and BuildConfig.java generated afterwards but I still don't have the R.java.

Some suggested cleaning up the project, editing manifest files and manually adding an R.java file so it would revert back to a generated one but none of these worked, though it showed a warning message in the IDE console when I edited the file but it didn't actually do anything


回答1:


  • Go to Windows->Android SDK Manager
  • Download or update Android SDK Build-tools

  • Open your project's properties

  • In the right panel, choose Java Build Path
  • In the left panel make sure that Android Private Libraries and Android Dependencies are checked.
  • Clean and rebuild your project



回答2:


Try to restart the your IDE and create a new project



来源:https://stackoverflow.com/questions/16633867/android-r-java-doesnt-generate

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