I disabled “play-services-analytics-impl-9.4.0” in the inspector for Android Platform and I can build, but, of course, lost the Analytics functionality. Somebody know how to solve this problem?
Are you sure that this is the right source for the duplicated classes?
In any case - it looks like you’re mixing libraries from 2 different versions (9.4.0 and 9.8.0).
My suggestions to you:
Make sure that these .aar libraries are indeed the ones that contain the duplicate classes.
Try to use the same version for all google play service libraries (e.g: 9.8.0).
Yes, I’m pretty sure that these are the source of the duplicated classes. I copied the correct aar from ANDROID_SDK/extras/google/m2repository/com/google/android/gms/play-services-analytics-impl/9.8.0/play-services-analytics-impl-9.8.0.aar but for some reason Unity put back the 9.4.0 version of the aar.
Many plugins use the google play “resolver” – a library that automatically will fetch any required google play services libraries into your project.
The issue is, that since this resolver runs automatically, its operation may actually conflict with other plugins in your project that already contain their own copies of google play services.
So, for example, in your case, you already have the library versioned 9.8.0, and the resolver keeps adding back 9.4.0 which causes a conflict (this is just speculation but sounds reasonable).