Is R.java file generated by Android SDK on each compile or only when new resources are added using Eclipse? Do I need to put it under version control or not?
Version control is a tool that allows you to keep track of changes to a number of files. Using version control for package development means that you can easily revert to previous package versions, collaborate with multiple developers, and record reasons for the changes that are made.
Don't commit generated filesclass files. Also do not commit .
Android R. java is an auto-generated file by aapt (Android Asset Packaging Tool) that contains resource IDs for all the resources of res/ directory. If you create any component in the activity_main. xml file, id for the corresponding component is automatically created in this file.
The R.java
file is generated during resource compilation by aapt
tool. You shouldn't add it to source control system.
Also, you should have noted the gen
folder where R.java
is placed. Your version control system should ignore this folder altogether, not only R.java
file inside it. Because this folder is deleted on clean build (not sure about eclipse, but ant
script definitely deletes it).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With