GSON not deleted - android

Why in my APK there is GSON even though I have nothing to implement GSON in Gradle?
Result Analyze APK
My Gradle :
//main
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.anko:anko-commons:0.10.5"
implementation "androidx.appcompat:appcompat:1.1.0"
implementation "androidx.constraintlayout:constraintlayout:1.1.3"
implementation "androidx.recyclerview:recyclerview:1.1.0"
implementation "androidx.paging:paging-runtime:2.1.1"
implementation "androidx.navigation:navigation-fragment-ktx:$nav_version"
implementation "androidx.navigation:navigation-ui-ktx:$nav_version"
implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version"
implementation "androidx.room:room-runtime:$room_version"
implementation "androidx.multidex:multidex:2.0.1"
implementation "com.android.volley:volley:1.1.1"
//google
implementation "com.google.android.gms:play-services-location:17.0.0"
implementation "com.google.android.material:material:1.0.0"
implementation "com.google.firebase:firebase-auth:19.2.0"
implementation "com.google.firebase:firebase-firestore:21.3.1"
implementation "com.google.firebase:firebase-storage:19.1.0"
implementation "com.google.firebase:firebase-messaging:20.1.0"
implementation "com.firebaseui:firebase-ui-storage:3.3.0"
// third party dependencies
implementation "com.balysv:material-ripple:1.0.2"
implementation "com.facebook.shimmer:shimmer:0.5.0"
implementation "com.squareup.moshi:moshi-kotlin:1.9.2"
implementation "com.tbuonomo.andrui:viewpagerdotsindicator:4.1.2"
implementation "com.github.bumptech.glide:glide:$glide_version"
//noinspection GradleDependency
implementation "com.journeyapps:zxing-android-embedded:3.6.0"
//kapt
kapt "com.github.bumptech.glide:compiler:$glide_version"
kapt "androidx.room:room-compiler:$room_version"
kapt "androidx.annotation:annotation:1.1.0"
// test
testImplementation 'junit:junit:4.13'
androidTestImplementation "androidx.test:runner:1.2.0"
androidTestImplementation "androidx.test.espresso:espresso-core:3.2.0"
I want to reduce my apk size, so I deleted the libary that I didn't use.

One or more of your dependencies has GSON in self.
i think it might be Glide or someone else.
for redecuing apk size check this topic might be helpful: Reduce the APK size - Android Developers

Related

How to fix Vulnerable WebRTC version error by third party libraries?

My Application in play developer console is showing error "Vulnerable WebRTC Versions, Your app uses a bad version of WebRTC, which contains security vulnerabilities."
I am using twilio video SDK, however it seems to be the latest version. Still cant figure out which library is using webrtc.
implementation platform('com.google.firebase:firebase-bom:31.1.1')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-messaging'
implementation 'com.google.firebase:firebase-crashlytics'
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'com.google.dagger:dagger-android-support:2.38'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.jakewharton:butterknife:10.2.3'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.google.code.gson:gson:2.8.9'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
debugImplementation "com.github.chuckerteam.chucker:library:3.5.2"
releaseImplementation "com.github.chuckerteam.chucker:library-no-op:3.5.2"
implementation 'com.squareup.picasso:picasso:2.71828'
implementation "androidx.lifecycle:lifecycle-runtime:2.5.1"
implementation "androidx.lifecycle:lifecycle-common-java8:2.5.1"
implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test:core:1.5.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.4'
androidTestImplementation 'androidx.test:runner:1.5.1'
androidTestImplementation "androidx.test:rules:1.5.0"
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0'
annotationProcessor 'com.google.dagger:dagger-android-processor:2.38'
annotationProcessor 'com.google.dagger:dagger-compiler:2.38'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.3'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation "com.google.android.material:material:1.8.0-beta01"
//nav components
implementation 'androidx.navigation:navigation-fragment:2.5.3'
implementation 'androidx.navigation:navigation-ui:2.5.3'
implementation 'com.github.aabhasr1:OtpView:v1.1.2'
implementation 'com.pusher:pusher-java-client:2.2.6'
implementation 'androidx.room:room-runtime:2.4.3'
annotationProcessor 'androidx.room:room-compiler:2.4.3'
implementation 'com.squareup:otto:1.3.8'
implementation 'com.twilio:video-android:7.5.1'
implementation "com.twilio:audioswitch:1.1.2"
implementation 'androidx.core:core-splashscreen:1.0.0'
implementation "androidx.coordinatorlayout:coordinatorlayout:1.2.0"
//progress bar
implementation 'com.github.uzairiqbal91:CircularTimerView:1.0'
implementation "androidx.work:work-runtime:2.7.1"
//country code picker
implementation 'com.hbb20:ccp:2.6.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'io.github.informramiz:nameinitialscircleimageview:1.6'
implementation 'com.github.Drjacky:ImagePicker:2.1.16'
//App update
implementation 'com.google.android.play:app-update:2.0.1'
//Live
implementation 'com.github.florent37:singledateandtimepicker:2.2.7'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
Is there a way to find which of these libraries use webrtc and what versions?

getting error on generating signed apk : Type com.google.gson.ExclusionStrategy is defined multiple times

when i am generating signed apk then i am getting this multiple error
Type com.google.gson.ExclusionStrategy is defined multiple times
xecution failed for task ':app:mergeDexRelease'.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
Type com.google.gson.ExclusionStrategy is defined multiple times: 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_libs_dex\release\mergeExtDexRelease\classes2.dex
my all dependencies
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'
Open your android studio project in Explorer. Delete the .gradle folder. The next step would be clean your project in android studio be clicking Build->Clean Project. After successful cleaning, Rebuild the project and re-run. This should probably fix your issue.

Duplicate Class found while adding Google Photos API Dependency

Throwing Duplicate Class found error after adding the google photos library api dependency
'com.google.photos.library:google-photos-library-client:1.5.0'
. Tried almost every solution present in SO, but nothing works.
My Gradle (Module) File (Dependencies)
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
// implementation project(':gcm')
//design
implementation 'androidx.appcompat:appcompat:1.2.0-alpha03'
implementation "com.google.android.material:material:${design_version.design}"
implementation "androidx.cardview:cardview:${design_version.card_view}"
implementation "androidx.recyclerview:recyclerview:${design_version.recycler_view}"
implementation 'com.balysv:material-ripple:1.0.2'
implementation "androidx.constraintlayout:constraintlayout:${design_version.constant_layout}"
implementation 'de.hdodenhof:circleimageview:3.0.0'
implementation 'com.makeramen:roundedimageview:2.3.0'
implementation 'se.emilsjolander:StickyScrollViewItems:1.1.0'
implementation 'androidx.multidex:multidex:2.0.1'
//image view
implementation 'com.squareup.picasso:picasso:2.71828'
//facebook integration
implementation 'com.facebook.android:account-kit-sdk:4.37.0'
//image cropper
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.+'
//chart
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
//glide
implementation 'com.github.bumptech.glide:glide:4.9.0'
//retrofit & square ok http & gson
implementation 'com.squareup.retrofit2:retrofit:2.5.0'
implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.11.0'
implementation "com.squareup.okhttp3:okhttp-urlconnection:3.0.1"
implementation 'com.squareup.retrofit2:converter-scalars:2.3.0'
implementation 'com.squareup.okhttp3:okhttp:3.12.0'
implementation 'com.google.code.gson:gson:2.8.6'
//firebase
implementation 'com.google.firebase:firebase-core:17.4.3'
implementation 'com.google.firebase:firebase-messaging:20.2.1'
implementation 'com.google.firebase:firebase-inappmessaging-display:19.0.7'
implementation 'com.google.firebase:firebase-analytics:17.4.3'
implementation 'com.google.firebase:firebase-config-ktx:19.1.4'
implementation 'com.google.firebase:firebase-database-ktx:19.3.1'
//validator
implementation 'com.github.SoumikBhatt.toaster:validator:1.2.6'
//popup
implementation 'com.github.SoumikBhatt.toaster:custompopup:1.2.6'
//proToast
implementation 'com.github.SoumikBhatt:ToastLikeAPro:1.0.1'
//Utils
implementation 'com.github.SoumikBhatt:Utills:1.0.1'
//force update
implementation 'com.github.SoumikBhatt:PushNotification:1.1.5'
//lottie
implementation 'com.airbnb.android:lottie:3.4.0'
//spotlight
implementation 'com.github.takusemba:spotlight:2.0.1'
//google photos
implementation 'com.google.photos.library:google-photos-library-client:1.5.0'
//flurry
// api 'com.flurry.android:analytics:12.0.3#aar'
implementation 'com.flurry.android:analytics:12.2.0'
implementation 'com.google.android.gms:play-services-base:17.3.0'
implementation 'com.google.android.gms:play-services-auth:18.0.0'
implementation 'com.baoyz.swipemenulistview:library:1.3.0'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation "androidx.core:core-ktx:1.1.0"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
Full error :
Duplicate class com.google.api.Advice found in modules jetified-proto-google-common-protos-1.17.0.jar (com.google.api.grpc:proto-google-common-protos:1.17.0) and jetified-protolite-well-known-types-17.0.0-runtime.jar (com.google.firebase:protolite-well-known-types:17.0.0)
Duplicate class com.google.api.Advice$1 found in modules jetified-proto-google-common-protos-1.17.0.jar (com.google.api.grpc:proto-google-common-protos:1.17.0) and jetified-protolite-well-known-types-17.0.0-runtime.jar (com.google.firebase:protolite-well-known-types:17.0.0)
.
.
.
Go to the documentation to learn how to Fix dependency resolution errors.
Any kind of help will be highly appreciated. TIA
It seems like Firebase has a similar dependency. Try suppressing in one of the dependencies in your gradle
Like this underneath the dependency:
configurations.implementation.exclude(group: 'com.google.firebase', module: 'protolite-well-known-types')
It should be something similar like this.
Reference here

package android.support.design.widget does not exist after refactor dependencies - Androidx api 28

After refactoring dependencies to androidx dependencies with android studio I keep getting errors when building. I looks like the application still uses the old depedencies, but I have tried to clean projekt and rebuild project... nothing helped.
Below is the dependencies I use in my application.
def retrofit_version = "2.4.0"
def glide_version = "4.3.1"
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
// Design Support
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.vectordrawable:vectordrawable-animated:1.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation "com.squareup.retrofit2:retrofit:$retrofit_version"
implementation "com.squareup.retrofit2:converter-gson:$retrofit_version"
implementation 'androidx.paging:paging-runtime:2.0.0'
implementation "com.github.bumptech.glide:glide:$glide_version"
annotationProcessor "com.github.bumptech.glide:compiler:$glide_version"
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel:2.0.0'
implementation 'androidx.preference:preference:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'

Duplicate class com.google.android.aidl.BaseProxy found in modules jetified-google-pay-client-api-1.0.0-runtime.jar

Code was working properly for whole day. And suddenly getting below error logs without changing any code.Duplicate dependencies are showing in app. Also tried to get tree structure of all used libraries in app.
Duplicate class com.google.android.aidl.BaseProxy found in modules jetified-google-pay-client-api-1.0.0-runtime.jar (google-pay-client-api-1.0.0.aar) and jetified-installreferrer-1.1-runtime.jar (com.android.installreferrer:installreferrer:1.1)
Duplicate class com.google.android.aidl.BaseStub found in modules jetified-google-pay-client-api-1.0.0-runtime.jar (google-pay-client-api-1.0.0.aar) and jetified-installreferrer-1.1-runtime.jar (com.android.installreferrer:installreferrer:1.1)
Duplicate class com.google.android.aidl.Codecs found in modules jetified-google-pay-client-api-1.0.0-runtime.jar (google-pay-client-api-1.0.0.aar) and jetified-installreferrer-1.1-runtime.jar (com.android.installreferrer:installreferrer:1.1)
Duplicate class com.google.android.aidl.TransactionInterceptor found in modules jetified-google-pay-client-api-1.0.0-runtime.jar (google-pay-client-api-1.0.0.aar) and jetified-installreferrer-1.1-runtime.jar (com.android.installreferrer:installreferrer:1.1)
Below are the dependencies in my app level gradle file.
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.squareup.picasso:picasso:2.71828' //Loading Image
implementation 'com.android.volley:volley:1.1.1'
implementation 'pro.appus:zoom-splash:1.0.0'//--------------Splash Animator---------------------
implementation 'com.flaviofaria:kenburnsview:1.0.7'
implementation 'com.facebook.android:facebook-login:[5,6)' //------Facebook Integration---------
implementation 'com.google.android.gms:play-services-auth:17.0.0'
implementation 'com.chabbal:slidingdotsplash:1.0.2'
//---------------Circular ImageView------------------------
implementation 'com.mikhaellopez:circularimageview:3.2.0'
implementation 'com.github.lzyzsd:circleprogress:1.2.1'
implementation 'com.github.bumptech.glide:glide:4.9.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
//---------------------Crop Library------------------------
implementation 'com.oginotihiro:cropview:1.0.0'
//-------------For Video Upload --------------------------
implementation 'com.squareup.retrofit2:retrofit:2.7.0'
implementation 'com.squareup.retrofit2:converter-gson:2.7.0'
// reactive
implementation 'io.reactivex.rxjava2:rxjava:2.1.10'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
implementation 'com.facebook.stetho:stetho:1.5.1'
implementation 'com.github.worker8:radiogroupplus:v1.0.1'
implementation 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
implementation 'androidx.viewpager2:viewpager2:1.0.0'
implementation 'me.grantland:autofittextview:0.2.+'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.19'
//-----PayU Money-----------
implementation 'com.payumoney.sdkui:plug-n-play:1.6.0'
implementation 'com.payumoney.core:payumoney-sdk:7.6.0'
//implementation'com.payu.custombrowser:payu-custom-browser:7.5.1'
implementation'com.payu.networking:payu-core-networking:1.1.0'
implementation'com.payu.payuanalytics:payuanalytics:1.1.1'
implementation'com.payu.upisdk:upisdk:1.0.2'
//implementation'com.payumoney.core:payumoney-sdk:7.6.0'
implementation'com.payumoney.graphics:asset-download-sdk:0.5.0'
//------CashFree--------------
implementation files ('libs/cashfreesdk-1.4-release.aar')
implementation files ("libs/google-pay-client-api-1.0.0.aar")
implementation 'com.google.android.gms:play-services-tasks:17.0.0'
implementation 'com.github.rubensousa:gravitysnaphelper:1.5'
//----------------Firebase Implementations------------------------------------------------------
implementation 'com.google.firebase:firebase-analytics:17.2.2'
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
implementation 'de.hdodenhof:circleimageview:3.0.1'
implementation 'com.github.smarteist:autoimageslider:1.3.2'
//----------------------Vimeo dependencies-------------------
implementation 'com.squareup.okhttp3:okhttp:3.14.4'
}
Spent almost 2 days to resolve these dependency issue, but no success. Any help will be really appreciated.
I also faced the same issue. Please find which library is using install referrer and Kindly update the library.
implementation 'com.android.installreferrer:installreferrer:1.1.1'

Categories

Resources