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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Sergio Diaz](https://secure.gravatar.com/avatar/e8753e1bed041988481c0d8385f02abe?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Sergio Diaz
511 PointsMy Code Won't Work
public class MainActivity extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
TextView answerLabel = (TextView) findViewById(R.id.textView1);
Button getanswerClick = (Button) findViewById(R.id.button1);
}
Above is the code that I wrote in eclipse. Eclipse sends me an error that says:
"textView1 cannot be resolved or is not a feild" "button1 cannot be resolved or is not a feild"
I double checked to make sure that button1 was the label for my button and that textView1 was the label for my textview
1 Answer
![Ben Junya](https://uploads.teamtreehouse.com/production/profile-photos/669042/micro_ben_hike.jpg)
Ben Junya
12,365 PointsSometimes Android does this super annoying thing when it doesn't register the labels for textviews. You've got a couple of options here:
1 (quick, but not guaranteed) Under "Project," click "Clean." and select your project. This will get rid of all the previous builds of your project that may be throwing errors. However, this may not solve all problems. It has to do with the errors from the updates being pushed by the Android SDK. You may want to try updating the SDK too. That may fix your problems, but again, it's not guaranteed.
2(slow, but guaranteed) Go use Android Studio. I jumped ship from Eclipse about 6 weeks ago and haven't looked back. Eclipse support is beginning to die out. While I loved Eclipse, and I enjoyed learning it, support is dying, and if you're looking to code more in the future, then Android Studio is going to be the official IDE of choice.
Sergio Diaz
511 PointsSergio Diaz
511 PointsThanks it worked