0

I changed the names of a couple of view items in one of my layout files, and suddenly my layout files (R.layout.) and views (R.id.) are getting redlined and not coming up in autocomplete.

I'm importing android.R. But it was working just fine until I renamed the layout items.

Any suggestions?

I've tried refresh, clean, and restarting Eclipse already.

Edit: I changed my import to:

package com.example.techgadgets;
import com.example.techgadgets.R;

but still no go.

1
  • 2
    I'm importing android.R, you are importing the wrong one. Commented May 24, 2014 at 20:19

2 Answers 2

4

Make sure your changed XML resource files do not have any errors. If there are errors in a resource file, then the aapt tool will not create an R.java file for you.

In my experience, that is the most common reason for the issue you are seeing.

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

1 Comment

Well, I was not seeing any errors, but somehow found that I was attempting to use a property that was not allowed for that view. That solved the problem. Now I'm onto the next strange difficulty...
4

As blackbelt says, you're importing android.R - you should be importing my.package.R instead, as this is the generated file that contains references to the entities in your res folder.

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.