1

I'm developing an android application and I've gotten pretty far already.

but recently I opened my eclipse again to continue my work, but there was a problem with my settings for the google play services. (I'm kinda sure it happened after I installed the new version (revision 7) from the android SDK manager.)

So I imported the google-play-services_lib and the google-play-services.jar again and the errors went away, so far so good I thought.

But now eclipse can't resolve R to a type and I can't run the app either...

I've searching the whole day to save my project from these errors and now I'm getting this one... btw the project ran perfectly for 4 months...

can anyone tell me wat to do?

EDIT: what I tried so far:

I've added all android build tools, google play services (libraries and projects),... Imported the google play services project into workspace and cleaned the project like 30 times. I Already checked private libraries, android dependencies etc. to export

Hans Vn
  • 787
  • 1
  • 16
  • 32
  • 1
    http://stackoverflow.com/questions/16636039/java-lang-classnotfoundexception-after-changing-nothing-in-the-project-but-upgra/16636127#16636127. check this link. makes sure you have installed android build tools from android sdk manager.Clean and build after that.makes sure you have checked android private libraires in order export tab of your java build path – Raghunandan May 24 '13 at 20:07
  • @Raghunandan I edited the question, I've already tried everything I could find on stackoverflow and google all day long (it's 22.30h right here now ;-) ) – Hans Vn May 24 '13 at 20:21
  • The R generated file does not get updated when you have errors in your resources files. There is something wrong there. One thing that is messed up is that eclipse sometimes doesn't show you the error location. my suggestion is to backup code -> delete project -> restart eclipse -> import project again. – Sam May 24 '13 at 20:23
  • @SamarthJain deleting is a bad idea. – Raghunandan May 24 '13 at 20:23
  • @Raghunandan still the same – Hans Vn May 24 '13 at 20:24
  • @HansVn do you any errors in your project resource files. did you check android private libraries for both library project and your project? – Raghunandan May 24 '13 at 20:25
  • @Raghunandan I agree. But eclipse behaves quite weird sometimes and that option generally works for me... This was one of the many reasons i moved away from eclipse and have now been using IntelliJ for a long time :) ... – Sam May 24 '13 at 20:26
  • @Raghunandan there are no errors in my project, I'm sure of that, because I didn't make any changes to the code itself, the problem started with the google play services. – Hans Vn May 24 '13 at 20:29
  • I had a similar mysterious problem with R.java not generating after downloading an ADT update. After not working for a while, another update came for 'build tools' and R.java started generating again. I doubt this is much help for you and I couldn't find any information either. – erisco May 24 '13 at 20:30
  • @HansVn how did you refer the google play services library project?. – Raghunandan May 24 '13 at 20:31
  • @HansVn you should refer to the library project. i guess you have added it as a jar in your lib folder is that right?? – Raghunandan May 24 '13 at 20:36

2 Answers2

0

I had the same problem I think. In /gen there was no R.java for me but when I updated my SDK-Tools everything was fine since they seem to have changed the order in the last version. Try that maybe!

0

Found it:

the SDK was already updated, but the device settings were changed somehow (now it was compiling for android 4.2.2 instead of 4.0.3) and when I cleaned the project, it updated some code I didn't notice, when setting the 4.0.3 build target again it wouldn't compile nor generate the R.java file (giving me loads of errors).

So what I did was change the project build target to 4.0.3 again, but I must have missed some lines of code that were updated to the 4.2.2 target... (leading to the R file not being generated, leading to more errors that were leading to more errors... just a vicious circle)

I didn't exactly remember what line caused the error, I was too happy it was solved I guess :)

Hans Vn
  • 787
  • 1
  • 16
  • 32
  • Not working dude.. Please provide a feasible solution.. When I import google-play-service-lib. R.java file gets deleted.. – Mitesh Shah Feb 10 '14 at 07:01