I was trying to upgrade implementation 'androidx.appcompat:appcompat:1.4.2'
to the implementation 'androidx.appcompat:appcompat:1.5.0'
. But it failed to build/run project showing the following errors in my logcat. The version 1.4.2 was working fine but when i updated it to 1.5.0 it shows errors and i can't run project. So how to resolve this issue?
Here is my build.gradle
file
dependencies {
implementation 'androidx.appcompat:appcompat:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
implementation 'androidx.preference:preference-ktx:1.2.0'
implementation 'androidx.core:core-ktx:1.8.0'
implementation 'com.google.android.material:material:1.6.1'
//Firebase
implementation 'com.google.firebase:firebase-analytics-ktx:21.1.0'
implementation 'com.google.firebase:firebase-crashlytics-ktx:18.2.12'
//Glide
implementation 'com.github.bumptech.glide:glide:4.13.2'
annotationProcessor 'com.github.bumptech.glide:compiler:4.13.2'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
Here is logcat
report conntaining errors
Duplicate class androidx.lifecycle.ViewModelLazy found in modules lifecycle-viewmodel-2.5.0-runtime (androidx.lifecycle:lifecycle-viewmodel:2.5.0) and lifecycle-viewmodel-ktx-2.3.1-runtime (androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1)
Duplicate class androidx.lifecycle.ViewTreeViewModelKt found in modules lifecycle-viewmodel-2.5.0-runtime (androidx.lifecycle:lifecycle-viewmodel:2.5.0) and lifecycle-viewmodel-ktx-2.3.1-runtime (androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1)
Go to the documentation to learn how to Fix dependency resolution errors.