0

I have used 2 libraries in my android project.

implementation 'com.firebaseui:firebase-ui-database:8.0.2'
implementation 'androidx.paging:paging-runtime:3.1.1'

And I got this below error:

Duplicate class androidx.lifecycle.ViewModelLazy found in modules jetified-lifecycle-viewmodel-ktx-2.2.0-runtime (androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0) and lifecycle-viewmodel-2.5.1-runtime (androidx.lifecycle:lifecycle-viewmodel:2.5.1)

I have tried "android.enableJetifier=true" this but doesn't work for me.

I know the same question asked in stack-overflow, but nothing work for me. Please help me to solve the issue.

build.gradle file:

plugins {
    id 'com.android.application'
    id 'com.google.gms.google-services'
}
android {
compileSdk 32

defaultConfig {
    applicationId "com.example.mk10"
    minSdk 24
    targetSdk 32
    versionCode 1
    versionName "1.0"

    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
}
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}
}

dependencies {

implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'com.google.android.material:material:1.7.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.google.firebase:firebase-auth:21.1.0'
implementation 'com.google.firebase:firebase-database:20.1.0'
implementation 'com.google.firebase:firebase-firestore:24.4.1'
implementation 'com.google.firebase:firebase-storage:20.1.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.4'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0'
//google location service
implementation 'com.google.android.gms:play-services-location:21.0.1'
//pick image
implementation 'com.github.dhaval2404:imagepicker:2.1'
//show images (glide)
implementation 'com.github.bumptech.glide:glide:4.14.2'
annotationProcessor 'com.github.bumptech.glide:compiler:4.14.2'
//geo-fire
implementation 'com.firebase:geofire-android:3.2.0'
//swipe-card
implementation 'com.github.flschweiger:SwipeStack:0.3.0'
//jason library
implementation 'com.google.code.gson:gson:2.9.0'
//swipe refresh layout
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
//firebase recyclerview ui
implementation 'com.firebaseui:firebase-ui-database:8.0.2'
implementation 'androidx.paging:paging-runtime:3.1.1'
}
Mukesh Roy
  • 47
  • 5

0 Answers0