Duplicate login error in liveata $ 1.class in android studio when trying to generate apk

I really don't know what causes this error and how to solve it.

my every addiction:

implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.android.support:appcompat-v7:27.1.0' implementation 'com.android.support.constraint:constraint-layout:1.0.2' implementation 'com.google.firebase:firebase-auth:11.8.0' implementation 'com.google.firebase:firebase-firestore:11.8.0' implementation 'com.firebaseui:firebase-ui-firestore:3.2.1' implementation 'com.google.firebase:firebase-crash:11.8.0' implementation 'com.google.firebase:firebase-storage:11.8.0' implementation ('com.facebook.android:facebook-android-sdk:4.31.0'){exclude group: 'com.android.support'} implementation'com.github.bumptech.glide:glide:4.6.1' annotationProcessor 'com.github.bumptech.glide:compiler:4.6.1' compile 'com.android.support:cardview-v7:27.1.0' compile 'com.android.support:recyclerview-v7:27.1.0' compile 'com.airbnb.android:lottie:2.3.0' compile 'com.squareup.picasso:picasso:2.5.2' compile 'com.theartofdev.edmodo:android-image-cropper:2.6.0' compile 'de.hdodenhof:circleimageview:2.2.0' implementation 'com.android.support:design:27.1.0' compile 'com.android.support:multidex:1.0.3' 

everything is fine, but after updating to 27.1.0

it causes an error while generating apk

Error: execution completed for task ': app: transformClassesWithJarMergingForRelease'.

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android / arch / lifecycle / LiveData $ 1.class

+5
source share
1 answer

This is likely due to mismatch of dependency versions. I checked the dependency tree that he had:

 android.arch.lifecycle:extensions:1.0.0 

and

 android.arch.lifecycle:livedata-core:1.1.0 

see mismatch 1.0.0 and 1.1.0

In your case, try updating:

 implementation 'com.firebaseui:firebase-ui-firestore:3.2.1' 

in

 implementation 'com.firebaseui:firebase-ui-firestore:3.2.2' 

which hopefully fix the version issue.

and note that compile not recommended to use implementation for all your dependencies.

Update:

You can always check the dependency tree with the gradlew your_app_name:dependencies command on Windows

+1
source

Source: https://habr.com/ru/post/1275686/


All Articles