I was working on my android project. After completing some coding, I imported remaining classes by pressing ctrl+shift+o
. Than I cleaned my project. After cleaning the project I lost my BuildConfig.java
file.
How can i get it back?
I think that R.java is now renamed as BuildConfig.java.(For all developers)
Am i right?
Thank you in advance.
Asked
Active
Viewed 841 times
1

Joshua Ulrich
- 173,410
- 32
- 338
- 418

Bhavin Panara
- 428
- 4
- 11
-
Please don't tag this question with [tag:r], the tag about the R-project for statistical computing. I have removed this tag. – Andrie Jun 26 '12 at 13:57
-
@Andrie: rather than only remove the `[r]` tag, please replace it with the `[r.java-file]` tag. – Joshua Ulrich Jun 26 '12 at 13:58
-
@JoshuaUlrich Thank you. I bow to the master. – Andrie Jun 26 '12 at 13:58
3 Answers
1
You should have an BuildConfig.java and an R.java in your gen folder (inside your package).
If the R.java isn't generated after cleaning, make sure that you don't have any errors in your layouts. (An layout error will cause the R to be removed and not to come back before a clean :) )

Ion Aalbers
- 7,830
- 3
- 37
- 50
1
Make sure you haven't imported an foreign R
file. Occasionally, CTRL+SHIFT+O
will import android.R
which will mess up your project. Delete the import statement, clean and build your project again.

Jason L
- 1,812
- 2
- 22
- 43
-
Note: copy-pasting code between projects will cause Eclipse to add an import statement without prompting or notification. – Jason L Jun 25 '12 at 16:19
-
I closed eclipse at night and when i see at morning R file was automatically generated.May be it was because of virus in my PC. – Bhavin Panara Jun 27 '12 at 07:50