Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should R.java be placed under version control

Tags:

android

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?

like image 380
bombardier Avatar asked May 25 '11 18:05

bombardier


People also ask

What is R version control?

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.

Should you commit .class files?

Don't commit generated filesclass files. Also do not commit .

What is the role of the R Java?

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.


1 Answers

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).

like image 154
inazaruk Avatar answered Oct 27 '22 09:10

inazaruk