After upgrade to Android SDK 10 R.java won't generate

Common bugs/problems with the Android SDK the Emulator and the ADT-Plugin.

After upgrade to Android SDK 10 R.java won't generate

Postby dglaser » Wed Mar 23, 2011 7:29 pm

Hi,

I am using eclipse 3.5 and I just upgraded to Android SDK 10. Before the upgrade my project was running fine with no errors. After upgrading it will not generate R.java.

In the console it is saying that it is unable to open classfile ../../R.java no such file or directory then it says
'aapt' error. Pre Compiler Build aborted.

In the problems section it is saying that I am missing the required source folder 'gen'.

I have tried do a project -> clean and then building again and I can not get it to generate the R.java. I have also closed the project and reopened it and have tried restarting eclipse. I have not made any changes and as I said above the project was building and running fine before I did the upgrade. Does anyone have any suggestions on how I can get it to generate the R.java file?

Thanks!
Diana

ETA: After posting this and restarting the computer my other projects are now not generating the R.java file :(
dglaser
Freshman
Freshman
 
Posts: 4
Joined: Wed Mar 23, 2011 6:43 pm

Top

Re: After upgrade to Android SDK 10 R.java won't generate

Postby blundell » Thu Mar 24, 2011 10:05 am

Hmmm, have you tried just creating a folder called 'gen' in the base directory of your project?
User avatar
blundell
Master Developer
Master Developer
 
Posts: 1610
Joined: Tue Nov 18, 2008 12:58 pm
Location: UK

Re: After upgrade to Android SDK 10 R.java won't generate

Postby dglaser » Thu Mar 24, 2011 2:25 pm

Thank you!!! Creating the folder worked. I don't know why it wasn't being generated all the sudden but at least it is solved!!!
dglaser
Freshman
Freshman
 
Posts: 4
Joined: Wed Mar 23, 2011 6:43 pm

Re: After upgrade to Android SDK 10 R.java won't generate

Postby blundell » Thu Mar 24, 2011 2:56 pm

R.java won't be generated when there are compile errors :-) fixing this fixed the compile error.
User avatar
blundell
Master Developer
Master Developer
 
Posts: 1610
Joined: Tue Nov 18, 2008 12:58 pm
Location: UK

Re: After upgrade to Android SDK 10 R.java won't generate

Postby raj_J2ME » Fri Mar 25, 2011 12:39 pm

Sometimes I face the same issue, while creating the new project, R.java does not get created and hence project contains the error. Sometime refreshing the project fix the same and some times it is not. I guess if I am creating the new project, and this error occurs this is due to the IDE.
what you guys says?
Thanks with Regards,
Raj - The Kernel
raj_J2ME
Master Developer
Master Developer
 
Posts: 311
Joined: Tue Feb 15, 2011 7:40 am
Location: The Capital of India,

Re: After upgrade to Android SDK 10 R.java won't generate

Postby blundell » Fri Mar 25, 2011 1:44 pm

R.java is generated when the project builds. Check:

Porjoect > Build Automatically : is ticked
User avatar
blundell
Master Developer
Master Developer
 
Posts: 1610
Joined: Tue Nov 18, 2008 12:58 pm
Location: UK

Top

Re: After upgrade to Android SDK 10 R.java won't generate

Postby raj_J2ME » Mon Mar 28, 2011 1:43 pm

That means you are saying that after creating the project, if one encounter the same issue, clicking the Porjoect > Build Automatically will fix the issue?
Thanks with Regards,
Raj - The Kernel
raj_J2ME
Master Developer
Master Developer
 
Posts: 311
Joined: Tue Feb 15, 2011 7:40 am
Location: The Capital of India,

Re: After upgrade to Android SDK 10 R.java won't generate

Postby blundell » Mon Mar 28, 2011 1:48 pm

*Project

Yes
User avatar
blundell
Master Developer
Master Developer
 
Posts: 1610
Joined: Tue Nov 18, 2008 12:58 pm
Location: UK

Re: After upgrade to Android SDK 10 R.java won't generate

Postby raj_J2ME » Mon Mar 28, 2011 6:54 pm

I have also seen that the configuring the build path, and selecting the Android jar file fix the issue..Today I have seen this with testing.
Thanks with Regards,
Raj - The Kernel
raj_J2ME
Master Developer
Master Developer
 
Posts: 311
Joined: Tue Feb 15, 2011 7:40 am
Location: The Capital of India,

Re: After upgrade to Android SDK 10 R.java won't generate

Postby kevat_patel » Tue Apr 05, 2011 7:55 am

select eclipse>project>Build Autometically option to generate r.java

if option is not selected
right click on you project from project explorer and select build project option which create r.java
kevat_patel
Developer
Developer
 
Posts: 46
Joined: Fri Mar 25, 2011 6:59 am

Top

Return to SDK/ADT/Emulator Problems

Who is online

Users browsing this forum: No registered users and 8 guests