Listing 2.14 icon does not show on screen

<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_right_24"
>         app:iconGravity="end" />

The icon do not show on screen. I have done this earlier with no problem, but now it will not show.

I notice you are using a different right arrow from the book which uses @drawable/arrow_right. Is this intentional and if so does it match what is in your drawable directory?

I think I am using a newer version of Android Studio than the book. This is the arrow that they list in there.
I have managed to get my system up and running with both arrow_right and arrow_left, but I think I renamed them.
I have to check every possible input to make things right. This is my implementation for adding a ViewModel:

implementation("androidx.core:core-ktx:1.13.1")
implementation("androidx.appcompat:appcompat:1.7.0")
implementation("com.google.android.material:material:1.12.0")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.6")
//implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1")
//noinspection GradleDependency
implementation("androidx.activity:activity-ktx:1.4.0")
//implementation("androidx.activity:activity-ktx:2.4.1")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.2.1")
androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1")

The settings in the book does not alway fit with Android studio requirements. Would be nice if you added source code for the newer version, or define what version the book is designed for. Or both.

Hi again, I’m just a fellow traveller through the book - have reached chapter 17, currently using AS ladybug 2024.2.1 patch 1. Like you I’ve noticed how quickly the software has moved on from that in the book. Particularly those settings. Somewhere I stumbled on the format in the book being Groovy and the version AS currently generates is kotlin which I guess at some point after the book was written became the default. So I’ve gone with that like you. I then found that studio gave warnings on some wanting to make them libs so I let it quickfix them while I was trying to get round some other problem. It then puts the version numbers in libs.version.toml

I’m not sure if it will be any use to you, but here is what I have.
dependencies {
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.appcompat)
implementation(libs.material)
implementation(libs.androidx.activity)
implementation(libs.androidx.constraintlayout)
implementation(“androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.6”)
implementation(“androidx.activity:activity-ktx:1.9.2”)
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)

Just had to add a vector asset in chapter 17 and remembered that arrow_left and arrow_right are just the names it tells you to type in after you’ve selected the arrow asset. So I guess we both have the same arrow but you didnt rename yours, which I guess should be ok as long as the xml name matches the drawable name.

I assume you have found their sample solutions they sometimes help a bit though they have got rather out of date. Cant remember where they were but if you haven’t found them I’ll try and find their location again

Hi June
Thanks a lot for your input. It is actually good to see that you have reached the same problems as I have. And that you have reached chapter 17!
I managed to get things up and running again. It seems that Android Studio put up different libraries based on what project you start with.
I will keep on working. At least we learn from the different changes.