I have a Unity 3d game (2021.2.7f1.4128 Personal) that I imported the Facebook Unity SDK into. I haven't made any other code changes or updates. Now, when Unity starts (before I even run my application) I get a repeating error that says:
AmbiguousMatchException: Ambiguous match found.
System.RuntimeType.GetMethodImplCommon (System.String name, System.Int32 genericParameterCount, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Reflection.CallingConventions callConv, System.Type[] types, System.Reflection.ParameterModifier[] modifiers) (at <31c0f51ac5a24a22ba784db24f4ba023>:0)
System.RuntimeType.GetMethodImpl (System.String name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Reflection.CallingConventions callConv, System.Type[] types, System.Reflection.ParameterModifier[] modifiers) (at <31c0f51ac5a24a22ba784db24f4ba023>:0)
System.Type.GetMethod (System.String name, System.Reflection.BindingFlags bindingAttr) (at <31c0f51ac5a24a22ba784db24f4ba023>:0)
System.Type.GetMethod (System.String name) (at <31c0f51ac5a24a22ba784db24f4ba023>:0)
GooglePlayServices.UnityCompat.GetUnity56AndAboveApplicationIdentifier (UnityEditor.BuildTarget buildTarget) (at /Users/smiles/dev/src/unity-jar-resolver/source/PlayServicesResolver/src/UnityCompat.cs:357)
GooglePlayServices.UnityCompat.GetApplicationId (UnityEditor.BuildTarget buildTarget) (at /Users/smiles/dev/src/unity-jar-resolver/source/PlayServicesResolver/src/UnityCompat.cs:411)
GooglePlayServices.PlayServicesResolver.GetAndroidApplicationId () (at /Users/smiles/dev/src/unity-jar-resolver/source/PlayServicesResolver/src/PlayServicesResolver.cs:955)
GooglePlayServices.PlayServicesResolver.OnSettingsChanged () (at /Users/smiles/dev/src/unity-jar-resolver/source/PlayServicesResolver/src/PlayServicesResolver.cs:2181)
GooglePlayServices.PlayServicesResolver..cctor () (at /Users/smiles/dev/src/unity-jar-resolver/source/PlayServicesResolver/src/PlayServicesResolver.cs:897)
Rethrow as TypeInitializationException: The type initializer for 'GooglePlayServices.PlayServicesResolver' threw an exception.
UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at <0cde216a590a4d6fbc3d7db7ac203c5d>:0)"
Anyone know how to resolve this issue?
It happens on my side on a new project as well - and so what I did is I removed the play services resolver ( the one added by facebook sdk ) and instead inported the External dependencies resolver - the one from google ( https://github.com/googlesamples/unity-jar-resolver )