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 trialFrankie Lamar
11,120 PointsI'm getting an error that says "Error:(19, 15) error: cannot find symbol class TextView" when I try and compile. Help
I'm getting an error that says "Error:(19, 15) error: cannot find symbol class TextView" when I try and compile. Help How do I fix this
2 Answers
Daniel Hartin
18,106 PointsHave you tried organizing imports (Ctrl + Shift + O if using Eclipse or if in Android studio You can go to File -> Settings -> Editor -> Auto Import -> Java and make the following changes:
change Insert imports on paste value to All
markAdd unambigious imports on the fly option as checked
(Or, on a Mac, do the same thing in Preferences))
Also make sure the I'd of the TextView in your XML matches exactly with what is defined in your java code.
If both of these have already been done it may be helpful if you could post your code both java code and XML please.
Hope this helps Daniel
Frankie Lamar
11,120 PointsThanks for you help. I imported android.widget.Button; and android.widget.TextView and my code compiled. I rewatched the video and the instructors IDE auto-imported for him.