No resource identifier found for attribute 'srcCompat' in package 'learnapp.android.example.com.learnapp'
<p>I am getting <code>Error:(26) No resource identifier found for attribute 'srcCompat' in package 'learnapp.android.example.com.learnapp'</code>
when I try to run my app.I have just started learning android today.I have added a new activity and dint change anything in any xml files.</p>

<p>This is the exact error:</p>

<pre><code>Documents/MyProjects/LearnApp/app/src/main/res/layout/activity_display_message.xml
Error:(26) No resource identifier found for attribute 'srcCompat' in package 'learnapp.android.example.com.learnapp'
</code></pre>

<p>Here is my activity_display_message.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:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    tools:context="learnapp.android.example.com.learnapp.DisplayMessageActivity"&gt;

    &lt;android.support.design.widget.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/AppTheme.AppBarOverlay"&gt;

        &lt;android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="?attr/colorPrimary"
            app:popupTheme="@style/AppTheme.PopupOverlay" /&gt;

    &lt;/android.support.design.widget.AppBarLayout&gt;

    &lt;include layout="@layout/content_display_message" /&gt;

    &lt;android.support.design.widget.FloatingActionButton
        android:id="@+id/fab"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom|end"
        android:layout_margin="@dimen/fab_margin"
        app:srcCompat="@android:drawable/ic_dialog_email" /&gt;

&lt;/LinearLayout&gt;
</code></pre>

<p>I have already read similar questions and saw that either the line </p>

<pre><code>xmlns:app="http://schemas.android.com/apk/res-auto"
</code></pre>

<p>or </p>

<pre><code>app:srcCompat="@android:drawable/ic_dialog_email" /&gt;
</code></pre>

<p>was wrong in their case which is not in my case.</p>

<p>Incase it matters this activity's parent activity is MainActivity.java</p>