title: Cannot find symbol errors in Android Studio Tutorial?
body: <p><a href="https://developer.android.com/training/basics/firstapp/building-ui.html#Weight" rel="nofollow">https://developer.android.com/training/basics/firstapp/building-ui.html#Weight</a></p>
  
  <p>I am doing the tutorial above and to get it to build I had to comment out these lines inside MainActivity.java inside src folder (This code is in the MainActivity class inside OnCreate()).</p>
  
  <pre><code>//        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
  //        setSupportActionBar(toolbar);
  //
  //        FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
  //        fab.setOnClickListener(new View.OnClickListener() {
  //            @Override
  //            public void onClick(View view) {
  //                Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
  //                        .setAction("Action", null).show();
  //            }
  //        });
  </code></pre>
  
  <p>If I do not comment out these lines, I get 'cannot find' errors and can't build, example:</p>
  
  <p>error: cannot find symbol variable toolbar</p>
  
  <p>Can someone explain in plain english why this is happening and how I can fix it? I have tried various import.R fixes that people found to combat Eclipse randomly adding that, but they don't work. My imports:</p>
  
  <pre><code>import android.os.Bundle;
  import android.support.design.widget.FloatingActionButton;
  import android.support.design.widget.Snackbar;
  import android.support.v7.app.AppCompatActivity;
  import android.support.v7.widget.Toolbar;
  import android.view.View;
  import android.view.Menu;
  import android.view.MenuItem;
  </code></pre>
  
  <p>I am using Android Studio like the tutorial says and get the same error on a clean install. Is it my automatically generated imports? Is the tutorial wrong or incompatible with the latest Android Studio? Are my build settings wrong?</p>