Type com.google.gson.ExclusionStrategy is defined multiple times

buzolive

New Member
i am generating signed apk to uploading on play store but i am getting this error on generate in android studio.....

Type com.google.gson.ExclusionStrategy is defined multiple times...

this is my gradle


apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
android {
compileSdkVersion 30
buildToolsVersion "30.0.2"

defaultConfig {
applicationId "com.lgt.buzo_live"
minSdkVersion 26
targetSdkVersion 30
versionCode 4
versionName "1.2"
multiDexEnabled true

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
ndk {
abiFilters "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
}
}
/*dexOptions {
javaMaxHeapSize "4g"
}*/
dexOptions {
preDexLibraries = false
}
aaptOptions { cruncherEnabled = false }
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'

}
}
firebaseCrashlytics {
nativeSymbolUploadEnabled true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildFeatures {

dataBinding {

enabled = true
}

}
packagingOptions {
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/notice'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license'
exclude 'META-INF/license.txt'
}
applicationVariants.all { variant ->
// Return compile configuration objects of a variant.
variant.getCompileConfiguration().resolutionStrategy {
// Use Gradle's ResolutionStrategy API
// to customize how this variant resolves dependencies.

}
// Return runtime configuration objects of a variant.
variant.getRuntimeConfiguration().resolutionStrategy {

}
// Return annotation processor configuration of a variant.
variant.getAnnotationProcessorConfiguration().resolutionStrategy {

}
}
}

dependencies {

implementation fileTree(dir: "libs", include: ["*.jar"])
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.android.volley:volley:1.1.1'
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'

//camera
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:eek:khttp: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.github.bkhezry.android-image-picker:imagepicker:1.4.0'
implementation 'com.firebaseui:firebase-ui-database:4.2.0'
implementation 'com.google.android.gms:play-services-auth:18.1.0'
implementation 'com.github.bumptech.glide:glide:4.11.0'
implementation 'com.google.firebase:firebase-auth:'
implementation 'com.google.firebase:firebase-database:'
implementation 'com.google.firebase:firebase-storage:'
implementation 'com.google.firebase:firebase-firestore:'
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', transitive: false)
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 'com.firebaseui:firebase-ui-firestore:6.3.0'
implementation 'androidx.paging:paging-runtime:2.1.2'
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'

//crashlystics
// Recommended: Add the Firebase SDK for Google Analytics.
implementation 'com.google.firebase:firebase-analytics:'
// Add the Firebase Crashlytics NDK dependency.
implementation 'com.google.firebase:firebase-crashlytics-ndk:17.2.2'
// 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')
implementation 'com.github.mike14u:croperino:1.1.8'
implementation 'com.google.firebase:firebase-messaging:'
implementation 'com.iceteck.silicompressorr:silicompressor:2.2.4'
implementation 'com.github.smarteist:autoimageslider:1.3.2-appcompat'
implementation 'com.makeramen:roundedimageview:2.3.0'
}
 

Attachments

Max

Administrator
Staff member
Good day.
First, please use CODE tag when inserting some code or configuration files to the post
1605148411524.png

Android SDK does not use the type com.google.gson.ExclusionStrategy directly, only com.google.gson.Gson (in Websocket connection establishing part of code)
You have a huge dependencies list in your project, please check them by excluding one after another. Seems like two of them use this type.
 

buzolive

New Member
Good day.
First, please use CODE tag when inserting some code or configuration files to the post
View attachment 2025
Android SDK does not use the type com.google.gson.ExclusionStrategy directly, only com.google.gson.Gson (in Websocket connection establishing part of code)
You have a huge dependencies list in your project, please check them by excluding one after another. Seems like two of them use this type.
please tell ,exact solution....
 

Max

Administrator
Staff member
You have a huge list of dependencies
Code:
dependencies {

implementation fileTree(dir: "libs", include: ["*.jar"])
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.android.volley:volley:1.1.1'
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'

//camera
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:eek:khttp: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.github.bkhezry.android-image-picker:imagepicker:1.4.0'
implementation 'com.firebaseui:firebase-ui-database:4.2.0'
implementation 'com.google.android.gms:play-services-auth:18.1.0'
implementation 'com.github.bumptech.glide:glide:4.11.0'
implementation 'com.google.firebase:firebase-auth:'
implementation 'com.google.firebase:firebase-database:'
implementation 'com.google.firebase:firebase-storage:'
implementation 'com.google.firebase:firebase-firestore:'
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', transitive: false)
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 'com.firebaseui:firebase-ui-firestore:6.3.0'
implementation 'androidx.paging:paging-runtime:2.1.2'
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'

//crashlystics
// Recommended: Add the Firebase SDK for Google Analytics.
implementation 'com.google.firebase:firebase-analytics:'
// Add the Firebase Crashlytics NDK dependency.
implementation 'com.google.firebase:firebase-crashlytics-ndk:17.2.2'
// 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')
implementation 'com.github.mike14u:croperino:1.1.8'
implementation 'com.google.firebase:firebase-messaging:'
implementation 'com.iceteck.silicompressorr:silicompressor:2.2.4'
implementation 'com.github.smarteist:autoimageslider:1.3.2-appcompat'
implementation 'com.makeramen:roundedimageview:2.3.0'
}
The problem is in one of them. Remove them consequentally until the problem is gone.
Or take an example application, Streaming-min for example, and add dependencies util the problem is reproduced.
 

buzolive

New Member
You have a huge list of dependencies
Code:
dependencies {

implementation fileTree(dir: "libs", include: ["*.jar"])
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.android.volley:volley:1.1.1'
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'

//camera
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:eek:khttp: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.github.bkhezry.android-image-picker:imagepicker:1.4.0'
implementation 'com.firebaseui:firebase-ui-database:4.2.0'
implementation 'com.google.android.gms:play-services-auth:18.1.0'
implementation 'com.github.bumptech.glide:glide:4.11.0'
implementation 'com.google.firebase:firebase-auth:'
implementation 'com.google.firebase:firebase-database:'
implementation 'com.google.firebase:firebase-storage:'
implementation 'com.google.firebase:firebase-firestore:'
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', transitive: false)
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 'com.firebaseui:firebase-ui-firestore:6.3.0'
implementation 'androidx.paging:paging-runtime:2.1.2'
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'

//crashlystics
// Recommended: Add the Firebase SDK for Google Analytics.
implementation 'com.google.firebase:firebase-analytics:'
// Add the Firebase Crashlytics NDK dependency.
implementation 'com.google.firebase:firebase-crashlytics-ndk:17.2.2'
// 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')
implementation 'com.github.mike14u:croperino:1.1.8'
implementation 'com.google.firebase:firebase-messaging:'
implementation 'com.iceteck.silicompressorr:silicompressor:2.2.4'
implementation 'com.github.smarteist:autoimageslider:1.3.2-appcompat'
implementation 'com.makeramen:roundedimageview:2.3.0'
}
The problem is in one of them. Remove them consequentally until the problem is gone.
Or take an example application, Streaming-min for example, and add dependencies util the problem is reproduced.

this is not the solution sir,,, please tell exact solution ..i have purchased flashphoner ,how can i get solution of this problem
 

Max

Administrator
Staff member
this is not the solution sir,,, please tell exact solution ..i have purchased flashphoner ,how can i get solution of this problem
This is the only solution. WCS Android SDK does not use the type com.google.gson.ExclusionStrategy, so you must check other dependencies.
 

buzolive

New Member
This is the only solution. WCS Android SDK does not use the type com.google.gson.ExclusionStrategy, so you must check other dependencies.
sir this error coming in your sdk.....see -> 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
 
Top