简体   繁体   中英

R.java file is not generated in a library project

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.

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

Under Preferences > Android (for that lib project)

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.

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

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM