Should updated dependency or library version numbers be used in the Gradle files?
The book spells out exactly what version of dependencies were used in the text. So for example… from Chapter 26 Listing 26.1 Becoming a composer (app/build.gradle):
...
dependencies {
...
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'androidx.compose.foundation:foundation:1.1.1'
implementation 'androidx.compose.runtime:runtime:1.1.1'
implementation 'androidx.compose.ui:ui:1.1.1'
implementation 'androidx.compose.ui:ui-tooling:1.1.1'
implementation 'androidx.compose.material:material:1.1.1'
implementation 'androidx.activity:activity-compose:1.4.0'
Is it OK to use the newer version numbers that are given by android studio? For the above example I’m being prompted to use the following:
implementation 'androidx.core:core-ktx:1.10.1'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.9.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.compose.foundation:foundation:1.4.3'
implementation 'androidx.compose.runtime:runtime:1.4.3'
implementation 'androidx.compose.ui:ui:1.4.3'
implementation 'androidx.compose.ui:ui-tooling:1.4.3'
implementation 'androidx.compose.material:material:1.4.3'
implementation 'androidx.activity:activity-compose:1.7.2'
or should I stick with the versions described in the book?
Summary
Should updated dependency or library version numbers be used in the Gradle files?