Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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