1

Suddenly my Android app is compiling with loads of errors in Eclipse. When I use Project-Clean the console shows it processing until 'Writing symbols for class R' then it pauses for around a minute and finishes with 'Nothing to pre compile' This behaviour follows adding several new strings to my strings.xml and replacing strings in the code with :-

getResources().getString(R.string.name of string);

Any ideas? Would it be safe to delete the R.java file to force it to rebuild perhaps?

2
  • I don't know what is your problem, but it is safe to delete the R.java file. Commented Sep 9, 2011 at 14:52
  • Fixed eventually - found another post which mentioned deleting the project and reimporting it. Tried that and it worked. Thanks tho for all the suggestions. Commented Sep 10, 2011 at 7:20

5 Answers 5

1

I faced a similar issue. I had missed putting a plus sign in android:id="@+id/GoTo". Everything was fine after I put back the missing plus sign, cleaned and rebuilt the project.

Sign up to request clarification or add additional context in comments.

Comments

0

When you use eclipse is very important after you change something in strings.xml to save that file and also rebuild !, if you have checked the option for build automatically than is enough just to CTRL+S if not you have to rebuild manually , cause your R.strings values are not jet updated

Comments

0

Check if you import the right R file. It should be your projects file, not android.R.

Comments

0

Maybe your listing is not exact code but if it is, then resources names can't contain spaces. (I am talking about R.string.name of string)

Comments

0

This is my currently todo list when I have that kind of problem:

  1. Refresh main project
  2. Clean
  3. Build All

if it wont work again. Close Eclipse -> repeat from 1.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.