R.java file is not generated in a library project

时光怂恿深爱的人放手 提交于 2019-12-14 03:24:51

问题


I'm trying to use the SlidingMenu library. As described, I created a new Android project using the library directory, tried "Project > Clean" to generate the R.java but doesn't work.

The curious fact is that if I open the project properties and uncheck the "Is Library" all will work and R.java file is generated without errors. Besides the errors with the lack of R.java file, the tab "Problems" presents this:

Unparsed aapt error(s)! Check the console for output.

If I remove, as suggested in several responses, it appears again when I clean the project.

I appreciate any suggestion.


回答1:


Un-checking and re-checking and "is library" helped for me.

Under Preferences > Android (for that lib project)




回答2:


There are many thing to get back R.java

  1. clean project
  2. Build project from project
  3. change the api of ex 2.2 to 4.0 and 4.0 to other version it will (re)create R.java file

finaly yet you cannot able to get R.java file then copy R.java file from other project paste it into gen folder then just build project.




回答3:


eclipse -> project -> build automatically -> check it

If it is already checked, uncheck it and check it again.




回答4:


Solved.

I do not know exactly what the reason, but the solution was to remove the Eclipse, the Android SDK and use the ADT Bundle from this link: http://developer.android.com/sdk/index.html

Before I was using a standard Eclipse IDE with the ADT plugin.

Thanks for the replies.



来源:https://stackoverflow.com/questions/16566053/r-java-file-is-not-generated-in-a-library-project

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