Duplicate class com.google.android.gms.common.api.zza

I am using cordova-plugin-firebase-analytics and cordova-plugin-admob-free and getting error as

java.lang.RuntimeException: Duplicate class com.google.android.gms.common.api.zza found in modules jetified-play-services-base-11.0.4-runtime.jar (com.google.android.gms:play-services-base:11.0.4) and jetified-play-services-basement-17.0.0-runtime.jar (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-11.0.4-runtime.jar (com.google.android.gms:play-services-base:11.0.4) and jetified-play-services-basement-17.0.0-runtime.jar (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-11.0.4-runtime.jar (com.google.android.gms:play-services-base:11.0.4) and jetified-play-services-basement-17.0.0-runtime.jar (com.google.android.gms:play-services-basement:17.0.0)
  Duplicate class com.google.android.gms.common.internal.zzq found in modules jetified-play-services-base-11.0.4-runtime.jar (com.google.android.gms:play-services-base:11.0.4) and jetified-play-services-basement-17.0.0-runtime.jar (com.google.android.gms:play-services-basement:17.0.0)
  Duplicate class com.google.android.gms.common.internal.zzr found in modules jetified-play-services-base-11.0.4-runtime.jar (com.google.android.gms:play-services-base:11.0.4) and jetified-play-services-basement-17.0.0-runtime.jar (com.google.android.gms:play-services-basement:17.0.0)
  Duplicate class com.google.android.gms.common.internal.zzs found in modules jetified-play-services-base-11.0.4-runtime.jar (com.google.android.gms:play-services-base:11.0.4) and jetified-play-services-basement-17.0.0-runtime.jar (com.google.android.gms:play-services-basement:17.0.0)

By doing some research I found that I need to match PLAY_SERVICES_VERSION for both the plugins, so tried as below

<plugin name="cordova-plugin-firebase-analytics" source="npm">
    <variable name="PLAY_SERVICES_VERSION" value="11.0.0" />
</plugin>
<plugin name="cordova-plugin-admob-free"> 
    <variable name="ADMOB_APP_ID" value="####" /> 
    <variable name="PLAY_SERVICES_VERSION" value="11.0.0" />
</plugin>

But facing the same issue, By googling more found that we need to remove
implementation ‘com.google.android.gms:play-services:11.0.1’

But how to do that in config.xml

What is the solution, Can anyone guide?

It’s not really a VoltBuilder issue . You might try asking the authors of the respective plugins.

Yes, I got that
The author is not supporting that plugin

Can Volt team help me?

I notice the GitHub page for cordova-plugin-admob-free says:

All cordova-plugin-admob-free should switch to use admob-plus-cordova for latest improvements.

You’ll have much better luck with the new supported admob plugin - however if for some reason that doesn’t work, I would suggest attempting to use the newer version (17.0.0) with your variable rather than the older version.

Yes, It’s worked with admob-plus-cordova

I figured out that we need to include cordova-plugin-androidx-adapter if any other legacy plugins used.