I have another activity whose layout has RelativeLayout, TextViews and an ImageView...no problems here.
With this other Activity below I have many TextViews and a RelativeLayout. When I add an Imageview, I receive the following errors:
Error:(190) No resource identifier found for attribute 'srcCompat' in package 'com.example.ftonyan.userposts' Error:(190) No resource identifier found for attribute 'srcCompat' in package 'com.example.ftonyan.userposts' Error:Execution failed for task ':app:processDebugResources'.
com.android.ide.common.process.ProcessException: Failed to execute aapt
The top part of the layout.xml for this problematic activity looks as follows before the imageview is added (the code compiles and runs on the emulator)
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
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">
After the imageview is added to the palette the following 2 lines are red (note the 2nd line was added by the system). The code no longer compiles.
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
Below is my Activity layout.xml. There are approximately 19 textViews in this layout. I did not include all of them for the sake of brevity.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
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">
<TextView
android:id="@+id/lblAddressees"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_below="@+id/lblNick"
android:layout_toStartOf="@+id/nickName"
android:text="Addressees:" />
<Button
android:id="@+id/goBack"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:background="@android:color/transparent"
android:text="back" />
<ImageView
android:id="@+id/imageView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/button6"
android:layout_centerHorizontal="true"
android:layout_marginBottom="87dp"
android:srcCompat="@mipmap/ic_launcher" />
</RelativeLayout>
I have read a few posts here recommending a change to the apk/res-auto line. However, that line is not in the file in the first place until the system adds it. So, not sure what I am supposed to do to fix this. Thanks in advance