No resource identifier found for attribute 'srcCompat' in package '....' <p>I will being by saying that I have seen SOME answers for this question on stackoverflow already, but only providing a quick 'fix' solution. I would like, if possible, to also understand WHY this is happening (an answer with some detailing).</p> <p>Now to get to the question: I have just re-started android development, using Android Studio 2.2 . I have an ios app which I want to port to android (meaning, recreate it for Android). I have started with a basic template from Android Studio, added a Constraint Layout and 2 ImageViews using 2 PNG files that I have copied in DRAWABLE folder.</p> <p>Without making any changes or whatsoever , when I try to build I get this error:</p> <p>Error:(11) No resource identifier found for attribute 'srcCompat' in package 'x.y.z'. This happens for both images. Here is the layout file:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/lib/x.y.z" xmlns:app2="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/activity_main" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="x.y.z.MainActivity"&gt; &lt;ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" app2:srcCompat="@drawable/pngFile1" android:id="@+id/imageView" app2:layout_constraintBottom_toBottomOf="parent" android:layout_marginEnd="8dp" app2:layout_constraintRight_toRightOf="parent" android:layout_marginBottom="8dp" android:layout_marginRight="8dp" /&gt; &lt;ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" app2:srcCompat="@drawable/pngFile2" android:id="@+id/imageView2" app2:layout_constraintBottom_toTopOf="@+id/imageView" app2:layout_constraintRight_toRightOf="@+id/imageView" android:layout_marginBottom="8dp" /&gt; </code></pre> <p></p> <p>Now, here are some things that I would like to understand, in order to have a proper answer to my question:</p> <ul> <li><p>some of the other answers I have found on SO propose to change the default:</p> <p>xmlns:app="http://schemas.android.com/apk/res-auto"</p></li> </ul> <p>to:</p> <pre><code>xmlns:app="http://schemas.android.com/apk/lib/x.y.z" </code></pre> <p>It's true that this removes the error from the build, but what seems strange to me (with my little-to-none android experience), is that Android Studio creates then another similar line when i add the 2nd image:</p> <pre><code>xmlns:app2="http://schemas.android.com/apk/res-auto" </code></pre> <p>And as we can see, it uses this for the images, so the errors appear again. </p> <p>I remember like one year ago i had worked on an app on Android Studio, and have used almost the same way of adding images / buttons with images and these problems were not there.</p> <p>That's why I would also like to understand why this is happening and how to fix it properly.</p> <p>Thanks in advance !</p>