Android 生成签名apk时出错:类型com.google.gson.ExclutionStrategy已定义多次

Android 生成签名apk时出错:类型com.google.gson.ExclutionStrategy已定义多次,android,dependencies,Android,Dependencies,当我生成有符号的apk时,我得到了这个多重错误 类型com.google.gson.ExclutionStrategy被多次定义 任务“:app:mergeDexRelease”的执行失败。 执行com.android.build.gradle.internal.tasks.Workers$ActionFacade时出错 com.android.builder.dexing.DexArchiveMergerException:合并dex存档时出错: 类型com.google.gson.Exclu

当我生成有符号的apk时,我得到了这个多重错误

类型com.google.gson.ExclutionStrategy被多次定义

任务“:app:mergeDexRelease”的执行失败。 执行com.android.build.gradle.internal.tasks.Workers$ActionFacade时出错 com.android.builder.dexing.DexArchiveMergerException:合并dex存档时出错: 类型com.google.gson.ExclutionStrategy被多次定义:D:\Irfan Android work2\Buzo New Project\Buzo New Project\Buzo Live Project\Buzo Live\wcs-Android-sdk-1.1.0.13-release\build.transforms\9a323f6c9651ded54ae1a99d98f60ca1\jetified-wcs-Android-sdk-1.1.0.13-release-runtime\classes.dex,D:\Irfan Android work2\Buzo New Project\Buzo New Project\Buzo Live Project\Buzo Live\app\build\intermediates\external\u libs\u dex\release\mergextdex release\classes2.dex

我的所有依赖项

implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'commons-validator:commons-validator:1.6'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'de.hdodenhof:circleimageview:3.1.0'
implementation 'com.google.android.gms:play-services-auth-api-phone:17.5.0'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.21'
implementation 'com.xw.repo:bubbleseekbar:3.20'
implementation 'android.arch.lifecycle:extensions:1.1.1'
api 'com.otaliastudios:cameraview:2.6.2'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'com.facebook.android:facebook-android-sdk:5.15.3'

// Retrofit & OkHttp
implementation 'com.squareup.okhttp3:logging-interceptor:4.2.2'
implementation 'com.squareup.okhttp:okhttp:2.7.5'
// Retrofit & OkHttp
implementation 'com.squareup.retrofit2:retrofit:2.6.2'
implementation 'com.squareup.retrofit2:converter-gson:2.6.2'
implementation 'com.github.angads25:toggle:1.1.0'
implementation 'net.alhazmy13.MediaPicker:libary:2.4.4'
implementation 'com.danikula:videocache:2.7.1'
//implementation 'com.google.code.gson:gson:2.8.2'

//implementation 'com.github.bkhezry.android-image-picker:imagepicker:1.4.0'

implementation 'com.google.android.gms:play-services-auth:18.1.0'
implementation 'com.github.bumptech.glide:glide:4.11.0'

annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
testImplementation 'junit:junit:4.13.1'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'

//volley
implementation 'com.android.volley:volley:1.1.1'
//

implementation project(path: ':wcs-android-sdk-1.1.0.13-release')

implementation 'com.trafi:anchor-bottom-sheet-behavior:0.13-alpha'
//like
implementation 'com.github.jd-alexander:LikeButton:0.2.3'
//
implementation 'com.github.f0ris.sweetalert:library:1.5.1'
implementation 'com.github.chrisbanes:PhotoView:2.3.0'
// FirebaseUI for Cloud Firestore

implementation 'gun0912.ted:tedpermission:2.2.3'
//country picker
implementation 'com.github.yesterselga:country-picker-android:1.0'
implementation 'com.github.florent37:viewanimator:1.1.0'


// Add the Firebase Crashlytics SDK.
implementation 'com.google.firebase:firebase-crashlytics:17.2.2'
//
//crop image
implementation platform('com.google.firebase:firebase-bom:26.0.0')
//firebase
implementation platform('com.google.firebase:firebase-bom:26.0.0')
implementation 'com.firebaseui:firebase-ui-firestore:6.3.0'
implementation 'androidx.paging:paging-runtime:2.1.2'
implementation 'com.google.firebase:firebase-auth:'
implementation 'com.google.firebase:firebase-database:'
implementation 'com.google.firebase:firebase-storage:'
implementation 'com.google.firebase:firebase-firestore:'
implementation 'com.google.firebase:firebase-messaging:'
implementation 'com.google.firebase:firebase-analytics:'
implementation 'com.firebaseui:firebase-ui-database:4.2.0'

implementation 'com.google.firebase:firebase-crashlytics-ndk:17.2.2'

implementation 'com.github.mike14u:croperino:1.1.8'

implementation 'com.iceteck.silicompressorr:silicompressor:2.2.4'
implementation 'com.github.smarteist:autoimageslider:1.3.2-appcompat'
implementation 'com.makeramen:roundedimageview:2.3.0'
implementation 'com.squareup.retrofit2:retrofit:2.6.2'

在资源管理器中打开android studio项目。删除
.gradle
文件夹。下一步是在android studio中清理项目,单击Build->cleanproject。成功清理后,重建项目并重新运行。这可能会解决您的问题。

已经解决了很多次……但仍然存在相同的问题。。。。