Reputation: 13
I am developing android software in Intellij 12.1 . I can access everything in R class and the project is running normally. But the R class appears empty when I open it in the editor. So my question is; Why R class appears empty?
Upvotes: 1
Views: 759
Reputation: 11
The question is old yet still relevant for someone starting with Android development. The answer for empty R class that worked for me is elsewhere:
I had to make sure that AAPT actually works to resolve the R class question.
It is located within the build tools directory of your Android SDK.
If AAPT does not work (i.e. R class is not generated at build or you are getting the "AAPT not ready to receive commands" error) try installing some older version of build tools via SDK manager.
This was the solution in my case.
Upvotes: 0
Reputation: 598
Try restart Intellij. But if you say that is everything OK, and is running well you don't have to worry. You don't have anything to do with the R file. You should not ever edit that file, it is auto-generated every time you make a change in you UI.
As I said before and as the Android Studio tells you when you open the R file: "Files under the build folder are generated and should not be edited."
Upvotes: 2