Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to get back R.java after cleaning the project in eclipse?

 
Vijay Nimkarde
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
I have configured the Android SDK in eclipse and all things are working fine,
But when I clean the project in eclipse R.java cleans out and it is not possible to get
back
. How to get back R.java after clean the project in eclipse?

or Is this solution that ...Not to clean the project just build and run?
Thanks in Advanced .
 
Misha van Tol
Ranch Hand
Posts: 56
Android Java Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
R.java should be re-created automatically when you clean a project. Does running build brings it back?
 
Vijay Nimkarde
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@ Misha van Tol
thanks for reply.
Yes I was tried by cleaning the project but there is shows errors at project icon in eclipse and project will not run because of error
and I dont understand what exactly error.
 
Pramod P Deore
Ranch Hand
Posts: 632
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I also faced the same problem couple of times. R.java is a auto-generated file that stores information about your drawables. If after cleaning project and restarting eclipse doesn't solve your issue then you have to create new project and copy paste your code to new project.
 
Vijay Nimkarde
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pramod P Deore wrote: If after cleaning project and restarting eclipse doesn't solve your issue then you have to create new project and copy paste your code to new project.

@ Pramod P Deore
Thats right ... but creating a new project after each time cleaning is not the proper way.
 
Pramod P Deore
Ranch Hand
Posts: 632
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No need to create new project each time because after cleaning project every time you will not face this problem.
 
Peter Raftos
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's possible that Eclipse has decided to import your R.java file into one or more of your classes.

Every so often, when clean/build doesn't seem to be working, if I check my import block at the top of the class file(s) I'm writing, I'll see

import blah/R.java

(or similar).

Delete, save and rebuild. It fixes the problem for me. I wish I knew what caused it.
 
Jenifer Private
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have also experienced this problem. What works for me is to delete the "gen" directory then clean and rebuild. Works every time.
 
Vijay Nimkarde
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@ Jenifer Private and Peter Raftos
thanks guys your things realy works.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic