'How to update dependencies in Android Studio?
When I try to Commit to Git in Android Studio I get a couple of Warnings about the dependencies:
A newer version of androidx.appcompat:appcompat than 1.4.0 is available: 1.4.1
A newer version of com.google.android.material:material than 1.4.0 is available: 1.5.0
A newer version of androidx.constraintlayout:constraintlayout than 2.1.2 is available: 2.1.3
Avoid using + in version numbers; can lead to unpredictable and unrepeatable builds (junit:junit:4.+)
Right now I have these dependencies in my "build.gradle" file:
dependencies {
implementation 'androidx.appcompat:appcompat:1.4.0'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
If I follow the suggestions from the Warnings and change the versions of the dependencies in my "build.gradle" file to:
...appcompat:1.4.1'
...material:1.5.0'
...constraintlayout:2.1.3'
So it looks like this:
dependencies {
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
I can no longer start the app!
What more do I need to do?
- Install/update these dependencies (how)?
- Resync anything (what and how)?
Solution 1:[1]
After searching the internet for quite a while and trying a couple of different things, like "Rebuild Project", I found the answer at Update dependencies - 3. Perform a Gradle sync/reload.
All I had to do after changing the versions of the dependencies in my "build.gradle" file was to Press the button "Sync Project with Gradle Files" in the Android Studio Gradle Toolbar.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |


