• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

xml error in Android Studio

brentc

Newbie
Nov 26, 2021
18
4
I have this code. I get an error at <ImageView....The error message is Resource Linking Failed...Why?

<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView 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:id="@+id/parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dp"
app:cardCornerRadius="10dp"
app:cardElevation="10dp">

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">

<TextView
android:id="@+id/txtName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:text="Contact Name"
android:textStyle="bold" />

<TextView
android:id="@+id/txtEmail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/txtName"
android:layout_centerHorizontal="true"
android:layout_marginTop="20dp"
android:text="Contact Email"
android:textStyle="italic"
android:layout_marginStart="5dp"/>

<ImageView
android:id="@+id/image"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_below="@id/txtEmail"
android:layout_marginTop="60dp"
android:centerHorizontal="true"
android:src="@drawable/ic_launcher_background" />

</RelativeLayout>
</androidx.cardview.widget.CardView>
 
Last edited:

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones