hanatharesh2712 / ionic-native-sms-retriever-plugin-master

Cross-platform plugin for Cordova / PhoneGap to Retrieve SMS. Available for Android.
27 stars 18 forks source link

Duplicate class error / play services #35

Closed thoechtl closed 2 years ago

thoechtl commented 2 years ago

I am using Capacitor and get the error below, unless I manually add a dependency to 'com.google.android.gms:play-services-auth:20.1.0 in my build.gradle. I don't use Cordova (anymore), but shouldn't this also be configured in the plugin.xml? The dependency is also mentioned in the Google Docs: https://developers.google.com/identity/sms-retriever/request?hl=en

Duplicate class com.google.android.gms.common.api.internal.zza found in modules jetified-play-services-base-15.0.1-runtime (com.google.android.gms:play-services-base:15.0.1) and jetified-play-services-basement-17.0.0-runtime (com.google.android.gms:play-services-basement:17.0.0)
Duplicate class com.google.android.gms.common.api.internal.zzb found in modules jetified-play-services-base-15.0.1-runtime (com.google.android.gms:play-services-base:15.0.1) and jetified-play-services-basement-17.0.0-runtime (com.google.android.gms:play-services-basement:17.0.0)
Duplicate class com.google.android.gms.common.api.internal.zzc found in modules jetified-play-services-base-15.0.1-runtime (com.google.android.gms:play-services-base:15.0.1) and jetified-play-services-basement-17.0.0-runtime (com.google.android.gms:play-services-basement:17.0.0)
Duplicate class com.google.android.gms.common.api.internal.zzd found in modules jetified-play-services-base-15.0.1-runtime (com.google.android.gms:play-services-base:15.0.1) and jetified-play-services-basement-17.0.0-runtime (com.google.android.gms:play-services-basement:17.0.0)
Duplicate class com.google.android.gms.common.api.zza found in modules jetified-play-services-base-15.0.1-runtime (com.google.android.gms:play-services-base:15.0.1) and jetified-play-services-basement-17.0.0-runtime (com.google.android.gms:play-services-basement:17.0.0)
Duplicate class com.google.android.gms.common.api.zzb found in modules jetified-play-services-base-15.0.1-runtime (com.google.android.gms:play-services-base:15.0.1) and jetified-play-services-basement-17.0.0-runtime (com.google.android.gms:play-services-basement:17.0.0)
Duplicate class com.google.android.gms.common.internal.zzb found in modules jetified-play-services-base-15.0.1-runtime (com.google.android.gms:play-services-base:15.0.1) and jetified-play-services-basement-17.0.0-runtime (com.google.android.gms:play-services-basement:17.0.0)
Duplicate class com.google.android.gms.common.internal.zzc found in modules jetified-play-services-base-15.0.1-runtime (com.google.android.gms:play-services-base:15.0.1) and jetified-play-services-basement-17.0.0-runtime (com.google.android.gms:play-services-basement:17.0.0)
Duplicate class com.google.android.gms.common.internal.zzd found in modules jetified-play-services-base-15.0.1-runtime (com.google.android.gms:play-services-base:15.0.1) and jetified-play-services-basement-17.0.0-runtime (com.google.android.gms:play-services-basement:17.0.0)
Duplicate class com.google.android.gms.common.internal.zzf found in modules jetified-play-services-base-15.0.1-runtime (com.google.android.gms:play-services-base:15.0.1) and jetified-play-services-basement-17.0.0-runtime (com.google.android.gms:play-services-basement:17.0.0)
Duplicate class com.google.android.gms.common.internal.zzg found in modules jetified-play-services-base-15.0.1-runtime (com.google.android.gms:play-services-base:15.0.1) and jetified-play-services-basement-17.0.0-runtime (com.google.android.gms:play-services-basement:17.0.0)
Duplicate class com.google.android.gms.common.internal.zzk found in modules jetified-play-services-base-15.0.1-runtime (com.google.android.gms:play-services-base:15.0.1) and jetified-play-services-basement-17.0.0-runtime (com.google.android.gms:play-services-basement:17.0.0)
Duplicate class com.google.android.gms.common.internal.zzl found in modules jetified-play-services-base-15.0.1-runtime (com.google.android.gms:play-services-base:15.0.1) and jetified-play-services-basement-17.0.0-runtime (com.google.android.gms:play-services-basement:17.0.0)
Duplicate class com.google.android.gms.common.internal.zzm found in modules jetified-play-services-base-15.0.1-runtime (com.google.android.gms:play-services-base:15.0.1) and jetified-play-services-basement-17.0.0-runtime (com.google.android.gms:play-services-basement:17.0.0)
Duplicate class com.google.android.gms.common.internal.zzn found in modules jetified-play-services-base-15.0.1-runtime (com.google.android.gms:play-services-base:15.0.1) and jetified-play-services-basement-17.0.0-runtime (com.google.android.gms:play-services-basement:17.0.0)
Duplicate class com.google.android.gms.common.zza found in modules jetified-play-services-base-15.0.1-runtime (com.google.android.gms:play-services-base:15.0.1) and jetified-play-services-basement-17.0.0-runtime (com.google.android.gms:play-services-basement:17.0.0)

Thanks for the great plugin :-)

hanatharesh2712 commented 2 years ago

@thoechtl It seems to me that you are using 2 different versions of play services(15.0.1 and 17.0.0). There may be some other plugin which is using a different version than this. so, In this case, you need to mention the play services version explicitly.

You can change/add this preferences for this plugin.

<plugin name="cordova-plugin-sms-retriever-manager" spec="1.0.3">
        <variable name="PLAY_SERVICES_VERSION" value="15.0.1" /> -- You can align play services version with other plugins which you have installed. (Play service must be same for all plugins which is using any play services)
</plugin>