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 Making a Button Do Something

Sven Schuett
Sven Schuett
1,384 Points

Cannot resolve symbol "showFactButton"

Have the code line:

Button showFactButton = (Button) findViewById(R.id.showFactButton);

the last "showFactButton" is in red color

ADB: Error:(21, 59) error: cannot find symbol variable showFactButton

thanks for help!

3 Answers

Jonas Schindler
Jonas Schindler
4,085 Points

Try a clean / rebuild of the project: Build -> clean or right-click on the gradle file and sync it.

That should solve it.

Sven Schuett
Sven Schuett
1,384 Points

Hey Jonas,

thanks for the fast answer!

Tried first to clean it, then to rebuild it and at the end to sync the gradle file.... still have the problem :(

Maybe a screenshot will help, but don't know how to upload a screenshot in this Forum :D

Spencer Heilner
Spencer Heilner
229 Points

I have the same problem. Clean and Rebuild doesn't work