问题
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
- clean project
- Build project from project
- 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