Hi, i am reading the book for a course and the step “Adding an icon to the NEXT button” is not working for me. Here is my code straight from the book.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/question_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="24dp"
tools:text="@string/question_australia" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:id="@+id/true_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/true_button" />
<Button
android:id="@+id/false_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/false_button" />
</LinearLayout>
<Button
android:id="@+id/next_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/next_button"
app:icon="@drawable/baseline_arrow_forward_24"
app:iconGravity="end" />
</LinearLayout>
But something is hapenning with that new “app” namespace i get the error;
Android resource linking failed
com.bignerdranch.android.geoquiz.app-mergeDebugResources-40:/layout/activity_main.xml:37: error: attribute icon (aka com.bignerdranch.android.geoquiz:icon) not found.
com.bignerdranch.android.geoquiz.app-mergeDebugResources-40:/layout/activity_main.xml:37: error: attribute iconGravity (aka com.bignerdranch.android.geoquiz:iconGravity) not found.
error: failed linking file resources.
I have the latest android studio version (Flamingo 2022.2.1 Patch 1), has something change in 2023 that make this code not work anymore?