title: Android Studio cannot find symbol variable
body: <p>I installed Android Studio about two days ago, I also installed the most updated version of Java and JDK 1.8 (I think it was Java SE 8u101).  I am able to edit code and I'm following a tutorial from the official Android Studio website. (Here: <a href="https://developer.android.com/training/basics/firstapp/building-ui.html" rel="nofollow">https://developer.android.com/training/basics/firstapp/building-ui.html</a>)</p>
  
  <p>However, upon hitting run I've gotten the two following errors:</p>
  
  <ol>
  <li><p>Error:(24, 57) error: cannot find symbol variable activity_display_message</p>
  
  <blockquote>
    <p>Code for this:</p>
    
    <blockquote>
      <p>ViewGroup layout = (ViewGroup) findViewById(R.id.<strong>activity_display_message</strong>);</p>
    </blockquote>
  </blockquote></li>
  <li><p>Error:(33, 25) error: cannot find symbol variable EXTRA_MESSAGE</p>
  
  <blockquote>
    <p>Code for this:</p>
    
    <blockquote>
      <p>intent.putExtra(EXTRA_MESSAGE, message);</p>
    </blockquote>
  </blockquote></li>
  </ol>
  
  <p>What might I be doing wrong? The emulator pops up and I can get to other apps on the phone but I just can't get my app to load.  Should I have installed Java SE 8u102 instead?</p>
  
  <p>I also got a second error message:</p>
  
  <blockquote>
    <p>Error:Execution failed for task ':app:compileDebugJavaWithJavac'. > Compilation failed; see the compiler error output for details.</p>
  </blockquote>
  
  <p>Any help is appreciated.</p>
  
  <p>Below is my code for the first xml file, "activity_main.xml":</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:orientation="horizontal"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
      &lt;EditText android:id="@+id/edit_message"
          android:layout_weight="1"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:hint="@string/edit_message" /&gt;
      &lt;Button
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="@string/button_send"
          android:onClick="sendMessage" /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Below is my code for "activity_display_message.xml"</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:paddingBottom="@dimen/activity_vertical_margin"
      android:paddingLeft="@dimen/activity_horizontal_margin"
      android:paddingRight="@dimen/activity_horizontal_margin"
      android:paddingTop="@dimen/activity_vertical_margin"
      tools:context="com.example.appno1.DisplayMessageActivity"&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>