Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Build a Simple Android App (2014) Basic Android Programming Accessing Views in Code

Why arent my IDs appearing when i write R.? I checked all file and all seems good.

When i write R. it suppose to show my id, but it doesnt do it. I checked my activity file and R file and all seems ok. And if i write them manualy Android Studio says that it cant find the symbol. Thanks for your help.

3 Answers

Daniel Hartin
Daniel Hartin
18,106 Points

As Andrew has pointed out make sure you type R.id. first then see what auto complete comes up with (use Ctrl + space to force auto complete to appear if it doesn't automatically).

Also make sure your XML file where you declared your id's is saved first as changes don't take effect until you save the changes to your XML file.

If all the above fails try going to Build - Rebuild project (or possibly clean project dependent on which version of android studio you have), this will rebuild your project and refresh everything.

Hope this helps Daniel

Andrew West
Andrew West
3,245 Points

Is it showing anything when you type R. ? When you type R. it should show a list of options like:

  • class
  • attri
  • dimen
  • drawable
  • id

If that is what you're seeing all you need to do is type R.id. and then you should see a list of your IDs.

So instead of R.showFactButton you need to type R.id.showFactButton

Thank so much guys! It's working now rebuilding the project. I also updated my android studio and it's working so much better. Thank you very much!