when i am trying to add dependency implementation 'com.google.android.gms:play-services-vision:11.8.0'
on my android studio project
it shows a list of errors
Duplicate class com.google.android.gms.common.api.internal.zza found in modules jetified-play-services-base-11.8.0-runtime.jar (com.google.android.gms:play-services-base:11.8.0) and jetified-play-services-basement-17.6.0-runtime.jar (com.google.android.gms:play-services-basement:17.6.0)
Duplicate class com.google.android.gms.common.api.internal.zzb found in modules jetified-play-services-base-11.8.0-runtime.jar (com.google.android.gms:play-services-base:11.8.0) and jetified-play-services-basement-17.6.0-runtime.jar (com.google.android.gms:play-services-basement:17.6.0)
Duplicate class com.google.android.gms.common.api.internal.zzc found in modules jetified-play-services-base-11.8.0-runtime.jar (com.google.android.gms:play-services-base:11.8.0) and jetified-play-services-basement-17.6.0-runtime.jar (com.google.android.gms:play-services-basement:17.6.0)
Duplicate class com.google.android.gms.common.api.internal.zzd found in modules jetified-play-services-base-11.8.0-runtime.jar (com.google.android.gms:play-services-base:11.8.0) and jetified-play-services-basement-17.6.0-runtime.jar (com.google.android.gms:play-services-basement:17.6.0)
Duplicate class com.google.android.gms.common.api.zza found in modules jetified-play-services-base-11.8.0-runtime.jar (com.google.android.gms:play-services-base:11.8.0) and jetified-play-services-basement-17.6.0-runtime.jar (com.google.android.gms:play-services-basement:17.6.0)
Duplicate class com.google.android.gms.common.api.zzb found in modules jetified-play-services-base-11.8.0-runtime.jar (com.google.android.gms:play-services-base:11.8.0) and jetified-play-services-basement-17.6.0-runtime.jar (com.google.android.gms:play-services-basement:17.6.0)
Duplicate class com.google.android.gms.common.internal.zzab found in modules jetified-play-services-base-11.8.0-runtime.jar (com.google.android.gms:play-services-base:11.8.0) and jetified-play-services-basement-17.6.0-runtime.jar (com.google.android.gms:play-services-basement:17.6.0)
Duplicate class com.google.android.gms.common.internal.zzac found in modules jetified-play-services-base-11.8.0-runtime.jar (com.google.android.gms:play-services-base:11.8.0) and jetified-play-services-basement-17.6.0-runtime.jar (com.google.android.gms:play-services-basement:17.6.0)
Duplicate class com.google.android.gms.common.internal.zzad found in modules jetified-play-services-base-11.8.0-runtime.jar (com.google.android.gms:play-services-base:11.8.0) and jetified-play-services-basement-17.6.0-runtime.jar (com.google.android.gms:play-services-basement:17.6.0)
Duplicate class com.google.android.gms.common.internal.zzae found in modules jetified-play-services-base-11.8.0-runtime.jar (com.google.android.gms:play-services-base:11.8.0) and jetified-play-services-basement-17.6.0-runtime.jar (com.google.android.gms:play-services-basement:17.6.0)
Duplicate class com.google.android.gms.common.internal.zzaf found in modules jetified-play-services-base-11.8.0-runtime.jar (com.google.android.gms:play-services-base:11.8.0) and jetified-play-services-basement-17.6.0-runtime.jar (com.google.android.gms:play-services-basement:17.6.0)
Duplicate class com.google.android.gms.common.internal.zzb found in modules jetified-play-services-base-11.8.0-runtime.jar (com.google.android.gms:play-services-base:11.8.0) and jetified-play-services-basement-17.6.0-runtime.jar (com.google.android.gms:play-services-basement:17.6.0)
Duplicate class com.google.android.gms.common.internal.zzr found in modules jetified-play-services-base-11.8.0-runtime.jar (com.google.android.gms:play-services-base:11.8.0) and jetified-play-services-basement-17.6.0-runtime.jar (com.google.android.gms:play-services-basement:17.6.0)
Duplicate class com.google.android.gms.common.internal.zzs found in modules jetified-play-services-base-11.8.0-runtime.jar (com.google.android.gms:play-services-base:11.8.0) and jetified-play-services-basement-17.6.0-runtime.jar (com.google.android.gms:play-services-basement:17.6.0)
Duplicate class com.google.android.gms.common.internal.zzt found in modules jetified-play-services-base-11.8.0-runtime.jar (com.google.android.gms:play-services-base:11.8.0) and jetified-play-services-basement-17.6.0-runtime.jar (com.google.android.gms:play-services-basement:17.6.0)
Duplicate class com.google.android.gms.common.internal.zzu found in modules jetified-play-services-base-11.8.0-runtime.jar (com.google.android.gms:play-services-base:11.8.0) and jetified-play-services-basement-17.6.0-runtime.jar (com.google.android.gms:play-services-basement:17.6.0)
Duplicate class com.google.android.gms.common.internal.zzv found in modules jetified-play-services-base-11.8.0-runtime.jar (com.google.android.gms:play-services-base:11.8.0) and jetified-play-services-basement-17.6.0-runtime.jar (com.google.android.gms:play-services-basement:17.6.0)
Duplicate class com.google.android.gms.common.internal.zzw found in modules jetified-play-services-base-11.8.0-runtime.jar (com.google.android.gms:play-services-base:11.8.0) and jetified-play-services-basement-17.6.0-runtime.jar (com.google.android.gms:play-services-basement:17.6.0)
Duplicate class com.google.android.gms.common.internal.zzx found in modules jetified-play-services-base-11.8.0-runtime.jar (com.google.android.gms:play-services-base:11.8.0) and jetified-play-services-basement-17.6.0-runtime.jar (com.google.android.gms:play-services-basement:17.6.0)
Duplicate class com.google.android.gms.common.internal.zzy found in modules jetified-play-services-base-11.8.0-runtime.jar (com.google.android.gms:play-services-base:11.8.0) and jetified-play-services-basement-17.6.0-runtime.jar (com.google.android.gms:play-services-basement:17.6.0)
Duplicate class com.google.android.gms.common.zze found in modules jetified-play-services-base-11.8.0-runtime.jar (com.google.android.gms:play-services-base:11.8.0) and jetified-play-services-basement-17.6.0-runtime.jar (com.google.android.gms:play-services-basement:17.6.0)
Duplicate class com.google.android.gms.dynamic.zza found in modules jetified-play-services-base-11.8.0-runtime.jar (com.google.android.gms:play-services-base:11.8.0) and jetified-play-services-basement-17.6.0-runtime.jar (com.google.android.gms:play-services-basement:17.6.0)
Duplicate class com.google.android.gms.dynamic.zzb found in modules jetified-play-services-base-11.8.0-runtime.jar (com.google.android.gms:play-services-base:11.8.0) and jetified-play-services-basement-17.6.0-runtime.jar (com.google.android.gms:play-services-basement:17.6.0)
Go to the documentation to learn how to Fix dependency resolution errors.
how can I fix it
and my dependencies here
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.google.android.gms:play-services-vision:11.8.0'
implementation 'com.google.android.gms:play-services-ads:20.1.0'
}
If you want to implement Ads in your project, It will be done with;
implementation 'com.google.android.gms:play-services-ads:20.1.0'
Just remove this;
implementation 'com.google.android.gms:play-services-vision:11.8.0'
Related
I am trying to implement the in-app review feature that Android has incorporated. I was following the guide to migrate the play core library so I can add this one (https://developer.android.com/guide/playcore#playcore-migration), so I did delete the play core library and updated some imports. The thing is, I keep getting this error, even after invalidating the caché:
Duplicate class com.google.android.play.core.common.IntentSenderForResultStarter found in modules core-1.10.3-runtime (com.google.android.play:core:1.10.3) and core-common-2.0.2-runtime (com.google.android.play:core-common:2.0.2)
Duplicate class com.google.android.play.core.common.LocalTestingException found in modules core-1.10.3-runtime (com.google.android.play:core:1.10.3) and core-common-2.0.2-runtime (com.google.android.play:core-common:2.0.2)
Duplicate class com.google.android.play.core.common.PlayCoreDialogWrapperActivity found in modules core-1.10.3-runtime (com.google.android.play:core:1.10.3) and core-common-2.0.2-runtime (com.google.android.play:core-common:2.0.2)
Duplicate class com.google.android.play.core.listener.StateUpdatedListener found in modules core-1.10.3-runtime (com.google.android.play:core:1.10.3) and core-common-2.0.2-runtime (com.google.android.play:core-common:2.0.2)
Duplicate class com.google.android.play.core.review.ReviewException found in modules core-1.10.3-runtime (com.google.android.play:core:1.10.3) and review-2.0.1-runtime (com.google.android.play:review:2.0.1)
Duplicate class com.google.android.play.core.review.ReviewInfo found in modules core-1.10.3-runtime (com.google.android.play:core:1.10.3) and review-2.0.1-runtime (com.google.android.play:review:2.0.1)
Duplicate class com.google.android.play.core.review.ReviewManager found in modules core-1.10.3-runtime (com.google.android.play:core:1.10.3) and review-2.0.1-runtime (com.google.android.play:review:2.0.1)
Duplicate class com.google.android.play.core.review.ReviewManagerFactory found in modules core-1.10.3-runtime (com.google.android.play:core:1.10.3) and review-2.0.1-runtime (com.google.android.play:review:2.0.1)
Duplicate class com.google.android.play.core.review.model.ReviewErrorCode found in modules core-1.10.3-runtime (com.google.android.play:core:1.10.3) and review-2.0.1-runtime (com.google.android.play:review:2.0.1)
Duplicate class com.google.android.play.core.review.model.zza found in modules core-1.10.3-runtime (com.google.android.play:core:1.10.3) and review-2.0.1-runtime (com.google.android.play:review:2.0.1)
Duplicate class com.google.android.play.core.review.testing.FakeReviewManager found in modules core-1.10.3-runtime (com.google.android.play:core:1.10.3) and review-2.0.1-runtime (com.google.android.play:review:2.0.1)
Duplicate class com.google.android.play.core.review.zza found in modules core-1.10.3-runtime (com.google.android.play:core:1.10.3) and review-2.0.1-runtime (com.google.android.play:review:2.0.1)
Duplicate class com.google.android.play.core.review.zzb found in modules core-1.10.3-runtime (com.google.android.play:core:1.10.3) and review-2.0.1-runtime (com.google.android.play:review:2.0.1)
Duplicate class com.google.android.play.core.review.zzc found in modules core-1.10.3-runtime (com.google.android.play:core:1.10.3) and review-2.0.1-runtime (com.google.android.play:review:2.0.1)
Duplicate class com.google.android.play.core.review.zzd found in modules core-1.10.3-runtime (com.google.android.play:core:1.10.3) and review-2.0.1-runtime (com.google.android.play:review:2.0.1)
Duplicate class com.google.android.play.core.review.zze found in modules core-1.10.3-runtime (com.google.android.play:core:1.10.3) and review-2.0.1-runtime (com.google.android.play:review:2.0.1)
Duplicate class com.google.android.play.core.review.zzf found in modules core-1.10.3-runtime (com.google.android.play:core:1.10.3) and review-2.0.1-runtime (com.google.android.play:review:2.0.1)
Duplicate class com.google.android.play.core.review.zzg found in modules core-1.10.3-runtime (com.google.android.play:core:1.10.3) and review-2.0.1-runtime (com.google.android.play:review:2.0.1)
Duplicate class com.google.android.play.core.review.zzh found in modules core-1.10.3-runtime (com.google.android.play:core:1.10.3) and review-2.0.1-runtime (com.google.android.play:review:2.0.1)
Duplicate class com.google.android.play.core.review.zzi found in modules core-1.10.3-runtime (com.google.android.play:core:1.10.3) and review-2.0.1-runtime (com.google.android.play:review:2.0.1)
I'm at a loss now, what can I do to make this work? I tried just using the play core library but in the testing track I can't see the in-app review so I'm assuming that doesn't work. Is there a fix?
Thank you.
I am building my project and getting the following errors of duplicate class
Duplicate class android.support.customtabs.ICustomTabsCallback found in modules browser-1.4.0-runtime (androidx.browser:browser:1.4.0) and customtabs-26.1.0-runtime (com.android.support:customtabs:26.1.0)
Duplicate class android.support.customtabs.ICustomTabsCallback$Stub found in modules browser-1.4.0-runtime (androidx.browser:browser:1.4.0) and customtabs-26.1.0-runtime (com.android.support:customtabs:26.1.0)
Duplicate class android.support.customtabs.ICustomTabsCallback$Stub$Proxy found in modules browser-1.4.0-runtime (androidx.browser:browser:1.4.0) and customtabs-26.1.0-runtime (com.android.support:customtabs:26.1.0)
Duplicate class android.support.customtabs.ICustomTabsService found in modules browser-1.4.0-runtime (androidx.browser:browser:1.4.0) and customtabs-26.1.0-runtime (com.android.support:customtabs:26.1.0)
Duplicate class android.support.customtabs.ICustomTabsService$Stub found in modules browser-1.4.0-runtime (androidx.browser:browser:1.4.0) and customtabs-26.1.0-runtime (com.android.support:customtabs:26.1.0)
Duplicate class android.support.customtabs.ICustomTabsService$Stub$Proxy found in modules browser-1.4.0-runtime (androidx.browser:browser:1.4.0) and customtabs-26.1.0-runtime (com.android.support:customtabs:26.1.0)
Duplicate class android.support.customtabs.IPostMessageService found in modules browser-1.4.0-runtime (androidx.browser:browser:1.4.0) and customtabs-26.1.0-runtime (com.android.support:customtabs:26.1.0)
Duplicate class android.support.customtabs.IPostMessageService$Stub found in modules browser-1.4.0-runtime (androidx.browser:browser:1.4.0) and customtabs-26.1.0-runtime (com.android.support:customtabs:26.1.0)
Duplicate class android.support.customtabs.IPostMessageService$Stub$Proxy found in modules browser-1.4.0-runtime (androidx.browser:browser:1.4.0) and customtabs-26.1.0-runtime (com.android.support:customtabs:26.1.0)
Duplicate class android.support.v4.app.INotificationSideChannel found in modules core-1.7.0-runtime (androidx.core:core:1.7.0) and support-compat-26.1.0-runtime (com.android.support:support-compat:26.1.0)
Duplicate class android.support.v4.app.INotificationSideChannel$Stub found in modules core-1.7.0-runtime (androidx.core:core:1.7.0) and support-compat-26.1.0-runtime (com.android.support:support-compat:26.1.0)
Duplicate class android.support.v4.app.INotificationSideChannel$Stub$Proxy found in modules core-1.7.0-runtime (androidx.core:core:1.7.0) and support-compat-26.1.0-runtime (com.android.support:support-compat:26.1.0)
These are my gradle dependencies
dependencies {
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation files('libs/release.aar')
implementation "androidx.browser:browser:1.3.0"
implementation "com.google.android.gms:play-services-ads:16.0.0"
implementation "com.google.android.gms:play-services-location:16.0.0"
implementation "com.google.android.exoplayer:exoplayer:2.17.1"
implementation "com.google.android.exoplayer:extension-ima:2.17.1"
}
Was to able to solve by adding android.enableJetifier=true in gradle.properties file
Duplicate class javax.annotation.Generated found in modules jetified-javax.annotation-api-1.3.2.jar (javax.annotation:javax.annotation-api:1.3.2) and jetified-jsr250-api-1.0.jar (javax.annotation:jsr250-api:1.0)
Duplicate class javax.annotation.PostConstruct found in modules jetified-javax.annotation-api-1.3.2.jar (javax.annotation:javax.annotation-api:1.3.2) and jetified-jsr250-api-1.0.jar (javax.annotation:jsr250-api:1.0)
Duplicate class javax.annotation.PreDestroy found in modules jetified-javax.annotation-api-1.3.2.jar (javax.annotation:javax.annotation-api:1.3.2) and jetified-jsr250-api-1.0.jar (javax.annotation:jsr250-api:1.0)
Duplicate class javax.annotation.Resource found in modules jetified-javax.annotation-api-1.3.2.jar (javax.annotation:javax.annotation-api:1.3.2) and jetified-jsr250-api-1.0.jar (javax.annotation:jsr250-api:1.0)
Duplicate class javax.annotation.Resource$AuthenticationType found in modules jetified-javax.annotation-api-1.3.2.jar (javax.annotation:javax.annotation-api:1.3.2) and jetified-jsr250-api-1.0.jar (javax.annotation:jsr250-api:1.0)
Duplicate class javax.annotation.Resources found in modules jetified-javax.annotation-api-1.3.2.jar (javax.annotation:javax.annotation-api:1.3.2) and jetified-jsr250-api-1.0.jar (javax.annotation:jsr250-api:1.0)
Duplicate class javax.annotation.security.DeclareRoles found in modules jetified-javax.annotation-api-1.3.2.jar (javax.annotation:javax.annotation-api:1.3.2) and jetified-jsr250-api-1.0.jar (javax.annotation:jsr250-api:1.0)
Duplicate class javax.annotation.security.DenyAll found in modules jetified-javax.annotation-api-1.3.2.jar (javax.annotation:javax.annotation-api:1.3.2) and jetified-jsr250-api-1.0.jar (javax.annotation:jsr250-api:1.0)
Duplicate class javax.annotation.security.PermitAll found in modules jetified-javax.annotation-api-1.3.2.jar (javax.annotation:javax.annotation-api:1.3.2) and jetified-jsr250-api-1.0.jar (javax.annotation:jsr250-api:1.0)
Duplicate class javax.annotation.security.RolesAllowed found in modules jetified-javax.annotation-api-1.3.2.jar (javax.annotation:javax.annotation-api:1.3.2) and jetified-jsr250-api-1.0.jar (javax.annotation:jsr250-api:1.0)
Duplicate class javax.annotation.security.RunAs found in modules jetified-javax.annotation-api-1.3.2.jar (javax.annotation:javax.annotation-api:1.3.2) and jetified-jsr250-api-1.0.jar (javax.annotation:jsr250-api:1.0)
//Libraries
// implementation platform('com.google.cloud:libraries-bom:20.8.0')
// compile ('com.google.cloud:google-cloud-speech')
after adding com.google.mlkit:face-detection:16.0.7 I have below log error
what should I do?
Duplicate class com.google.firebase.components.Component found in modules jetified-firebase-common-16.0.3-runtime (com.google.firebase:firebase-common:16.0.3) and jetified-firebase-components-16.0.0-runtime (com.google.firebase:firebase-components:16.0.0)
Duplicate class com.google.firebase.components.Component$1 found in modules jetified-firebase-common-16.0.3-runtime (com.google.firebase:firebase-common:16.0.3) and jetified-firebase-components-16.0.0-runtime (com.google.firebase:firebase-components:16.0.0)
Duplicate class com.google.firebase.components.Component$Builder found in modules jetified-firebase-common-16.0.3-runtime (com.google.firebase:firebase-common:16.0.3) and jetified-firebase-components-16.0.0-runtime (com.google.firebase:firebase-components:16.0.0)
Duplicate class com.google.firebase.components.ComponentContainer found in modules jetified-firebase-common-16.0.3-runtime (com.google.firebase:firebase-common:16.0.3) and jetified-firebase-components-16.0.0-runtime (com.google.firebase:firebase-components:16.0.0)
Duplicate class com.google.firebase.components.ComponentFactory found in modules jetified-firebase-common-16.0.3-runtime (com.google.firebase:firebase-common:16.0.3) and jetified-firebase-components-16.0.0-runtime (com.google.firebase:firebase-components:16.0.0)
Duplicate class com.google.firebase.components.ComponentRegistrar found in modules jetified-firebase-common-16.0.3-runtime (com.google.firebase:firebase-common:16.0.3) and jetified-firebase-components-16.0.0-runtime (com.google.firebase:firebase-components:16.0.0)
Duplicate class com.google.firebase.components.Dependency found in modules jetified-firebase-common-16.0.3-runtime (com.google.firebase:firebase-common:16.0.3) and jetified-firebase-components-16.0.0-runtime (com.google.firebase:firebase-components:16.0.0)
Duplicate class com.google.firebase.components.DependencyCycleException found in modules jetified-firebase-common-16.0.3-runtime (com.google.firebase:firebase-common:16.0.3) and jetified-firebase-components-16.0.0-runtime (com.google.firebase:firebase-components:16.0.0)
Duplicate class com.google.firebase.components.DependencyException found in modules jetified-firebase-common-16.0.3-runtime (com.google.firebase:firebase-common:16.0.3) and jetified-firebase-components-16.0.0-runtime (com.google.firebase:firebase-components:16.0.0)
Duplicate class com.google.firebase.components.MissingDependencyException found in modules jetified-firebase-common-16.0.3-runtime (com.google.firebase:firebase-common:16.0.3) and jetified-firebase-components-16.0.0-runtime (com.google.firebase:firebase-components:16.0.0)
Duplicate class com.google.firebase.events.Event found in modules jetified-firebase-common-16.0.3-runtime (com.google.firebase:firebase-common:16.0.3) and jetified-firebase-components-16.0.0-runtime (com.google.firebase:firebase-components:16.0.0)
Duplicate class com.google.firebase.events.EventHandler found in modules jetified-firebase-common-16.0.3-runtime (com.google.firebase:firebase-common:16.0.3) and jetified-firebase-components-16.0.0-runtime (com.google.firebase:firebase-components:16.0.0)
Duplicate class com.google.firebase.events.Publisher found in modules jetified-firebase-common-16.0.3-runtime (com.google.firebase:firebase-common:16.0.3) and jetified-firebase-components-16.0.0-runtime (com.google.firebase:firebase-components:16.0.0)
Duplicate class com.google.firebase.events.Subscriber found in modules jetified-firebase-common-16.0.3-runtime (com.google.firebase:firebase-common:16.0.3) and jetified-firebase-components-16.0.0-runtime (com.google.firebase:firebase-components:16.0.0)
Duplicate class com.google.firebase.inject.Provider found in modules jetified-firebase-common-16.0.3-runtime (com.google.firebase:firebase-common:16.0.3) and jetified-firebase-components-16.0.0-runtime (com.google.firebase:firebase-components:16.0.0)
Go to the documentation to learn how to Fix dependency resolution errors.
you may have an existing firebase dependency that pulls in com.google.firebase:firebase-common:16.0.3 which is not compatible with the mlkit APIs. You can resolve this by using the latest firebase BOM which specifies the latest versions for all firebase SDKs:
// Import the BoM for the Firebase platform
implementation platform('com.google.firebase:firebase-bom:28.0.1')
// OR, just explicitly pull in the latest firebase-common dependency in your project:
implementation 'com.google.firebase.firebase-common-20.0.0'
I'm getting duplicate class errors when I try to build android app that use firebase-firestore and google-cloud-language.
Duplicate class com.google.api.Advice found in modules classes.jar (com.google.firebase:protolite-well-known-types:16.0.1) and proto-google-common-protos-1.15.0.jar (com.google.api.grpc:proto-google-common-protos:1.15.0)
Duplicate class com.google.api.Advice$1 found in modules classes.jar (com.google.firebase:protolite-well-known-types:16.0.1) and proto-google-common-protos-1.15.0.jar (com.google.api.grpc:proto-google-common-protos:1.15.0)
Duplicate class com.google.api.Advice$Builder found in modules classes.jar (com.google.firebase:protolite-well-known-types:16.0.1) and proto-google-common-protos-1.15.0.jar (com.google.api.grpc:proto-google-common-protos:1.15.0)
Duplicate class com.google.api.AdviceOrBuilder found in modules classes.jar (com.google.firebase:protolite-well-known-types:16.0.1) and proto-google-common-protos-1.15.0.jar (com.google.api.grpc:proto-google-common-protos:1.15.0)
...
Duplicate class com.google.type.TimeOfDayProto found in modules classes.jar (com.google.firebase:protolite-well-known-types:16.0.1) and proto-google-common-protos-1.15.0.jar (com.google.api.grpc:proto-google-common-protos:1.15.0)
My build.gradle looks like follow:
...
dependencies {
...
implementation 'com.google.firebase:firebase-ml-vision:20.0.0'
implementation 'com.google.firebase:firebase-firestore:19.0.0'
implementation 'io.grpc:grpc-okhttp:1.19.0'
implementation'com.google.cloud:google-cloud-language:1.76.0'
}
How can I solve the issuse ?