0

I opened an android application project called Test Canvas and later cleaned it by Project > Clean ... 'Bulid Automatically' option was ticked. Then the R.java file was deleted and it did not regenerated.I tried all the other options mentioned in the questions of stackexchange.But the R.java file remained missing.

One answer said that R.java generation fails because of errors in .xml files.But there were no errors.I'm 100% sure.

Then i created a new android application project which cannot have any issues in xml files.

When i created the new project it didn't came with the R.java file. I tried cleaning and building with different combinations.It still doesn't work.

I am using eclipse Helios Android API 15 Android SDK Manager Revision 22 JDK 7U25

Can any one help me on this please?

direndd
  • 642
  • 2
  • 16
  • 47

3 Answers3

0

I understand you have tried cleaning the project. What I would like you to do is Build the project and check the console for any errors.

The R.java also doesn't gets generated if the your project contains errors and these errors are clearly mentioned in your console.

Have a look and see if you can resolve your problem.

user_CC
  • 4,686
  • 3
  • 20
  • 15
  • I built the project still no change. And console doesn't show anything. Only error it shows is in the problems tab like in the previous comment. – direndd Jul 04 '13 at 17:00
  • what error is it showing? Can you check the problems tab and see what errors is it showing there? – user_CC Jul 05 '13 at 07:49
0

Try the following

  • Close and Reopen the project
  • Ensure your project folder has 777 rights
  • Use a later version of Android, that triggers a clean build
  • Check Problems tab, sometimes errors are not shown on the project files/folder, but a error shows up in this tab
  • Check top to see the amount of memory you have left, sometimes OOM screws things up

Please use a more later version 1.5 is like decades old

Siddharth
  • 9,349
  • 16
  • 86
  • 148
  • He clearly said `Android API 15`, not `Android 1.5`... – silentw Jul 04 '13 at 16:53
  • Reopening the project didn't work. I am working on Win* 64 bit.I don't know how to set 777 rights in that. I have to use API level 15 (Not 1.5) for my app Problems tab shows that R cannot be resolved to a variable MainActivity.java /TestR/src/testR/testr line 12 Java Problem And it shows i have plenty of memory. – direndd Jul 04 '13 at 16:57
0

Try this.

  • Open the properties of your Project
  • Go to the Android Build target of your Application
  • Just change the from the currently checked one to another version(can be anything, but one that is supported to at least the minSDK declared in the Manifest)
  • Do a clean build, if your Project has no issues like in your resources like hyphens in draw able names,unrecognized strings,missing dimension values etc ... your Project should generate the R package with the R class
Mushtaq Jameel
  • 7,053
  • 7
  • 33
  • 52
  • I did the steps you told and changed the build target from 4.0.3 to 3.2 and then cleaned and built. still no change. I created a new project even that doesn't have a R file.A new project can't have any issues right? :) – direndd Jul 04 '13 at 17:13
  • If you have build automatically checked then a clean would delete the bin files and restore them, uncheck build automatically and follow the steps again and then do a build only. – Mushtaq Jameel Jul 04 '13 at 17:47
  • Right-click on the project then Android Tools -> Fix Project Properties. – Mushtaq Jameel Jul 04 '13 at 17:50
  • Did that also.still not working. :( – direndd Jul 05 '13 at 05:39