Home > Blockchain >  Xamarin Android google libraries defining the same class
Xamarin Android google libraries defining the same class

Time:12-09

I updated the libraries on my Xamarin Android application, and I get the following error: com.google.android.gms.internal.ads.zza is defined multiple times: obj\Debug\120\lp\107\jl\bin\classes.jar:com/google/android/gms/internal/ads/zza.class, obj\Debug\120\lp\116\jl\bin\classes.jar:com/google/android/gms/internal/ads/zza.class

Here are the libraries that collide based on the manifest files found in these folders:

  • com.google.android.gms.gass -> Xamarin.GooglePlayServices.Gass version 120.0.0.7
  • com.google.android.gms.ads.impl -> I assume it's Xamarin.GooglePlayServices.Ads version 121.3.0

Is there any thoughts how can I overcome this issue? My app does not build. I tried many version combinations, none of them helped.

I tried many version combinations, none of them helped.

CodePudding user response:

I have checked the android natived library: com.google.android.gms:play-services-gass 20.0.0, its last updated time is Apr 07, 2021. This is the Xamarin.GooglePlayServices.Gass nuget package 120.0.0.x in the xamarin.

And the native library com.google.android.gms: play-services-ads version 20.0.0 is published at Apr 05, 2021. So I created a sample to test the two nuget packages:

  1. Xamarin.GooglePlayServices.Ads version 120.0.0
  2. Xamarin.GooglePlayServices.Gass version 120.0.0.7

The error message disappeared. In addition, you can also uninstall the Xamarin.GooglePlayServices.Gass and only use the Xamarin.GooglePlayServices.Ads version 121.3.0, it should contains the api in the Xamarin.GooglePlayServices.Gass.

  • Related