1

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.

Joshua Ulrich
  • 173,410
  • 32
  • 338
  • 418
Bhavin Panara
  • 428
  • 4
  • 11

3 Answers3

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
0

Clean the project 2-3 times. It will work.

Rookie
  • 8,660
  • 17
  • 58
  • 91