Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Bug `AmbiguousMatchException` in `GooglePlayServices` when targeting android as of 2021.2

Discussion in '2021.2 Beta' started by Bersaelor, Jul 1, 2021.

  1. Bersaelor

    Bersaelor

    Joined:
    Oct 8, 2016
    Posts:
    111
    Hey there, it looks like I'm getting the following error a lot as of 2021.2, when setting the build target to Android:

    Code (CSharp):
    1. AmbiguousMatchException: Ambiguous match found.
    2. 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 <202f8c081a504aa2940103428e3fd66b>:0)
    3. 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 <202f8c081a504aa2940103428e3fd66b>:0)
    4. System.Type.GetMethod (System.String name, System.Reflection.BindingFlags bindingAttr) (at <202f8c081a504aa2940103428e3fd66b>:0)
    5. System.Type.GetMethod (System.String name) (at <202f8c081a504aa2940103428e3fd66b>:0)
    6. GooglePlayServices.UnityCompat.GetUnity56AndAboveApplicationIdentifier (UnityEditor.BuildTarget buildTarget) (at <6161ea2c3dc848909cf65dd754b884ec>:0)
    7. GooglePlayServices.UnityCompat.GetApplicationId (UnityEditor.BuildTarget buildTarget) (at <6161ea2c3dc848909cf65dd754b884ec>:0)
    8. GooglePlayServices.PlayServicesResolver.GetAndroidApplicationId () (at <6161ea2c3dc848909cf65dd754b884ec>:0)
    9. GooglePlayServices.PlayServicesResolver.<PollBundleId>m__36 () (at <6161ea2c3dc848909cf65dd754b884ec>:0)
    10. GooglePlayServices.PlayServicesResolver+PropertyPoller`1[T].Poll (System.Func`1[TResult] getCurrentValue, GooglePlayServices.PlayServicesResolver+PropertyPoller`1+Changed[T] changed) (at <6161ea2c3dc848909cf65dd754b884ec>:0)
    11. GooglePlayServices.PlayServicesResolver.PollBundleId () (at <6161ea2c3dc848909cf65dd754b884ec>:0)
    12. UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at /Users/bokken/buildslave/unity/build/Editor/Mono/EditorApplication.cs:356)
    13.  
    Is this my problem or a problem with 2021.2 ? I haven't seen this issue before and have not changed anything in my Android setup.
    It doesn't actually prevent me from running the app on android, it just seems to happen during editor work, without even pressing play. (exception occurs about 4 times per minute on an idle editor)
     
    appdex01 likes this.
  2. Bersaelor

    Bersaelor

    Joined:
    Oct 8, 2016
    Posts:
    111
    PS: This is thrown once when opening the project and looks related:
    Code (CSharp):
    1. Exception thrown when initializing PlayServicesResolver: System.Reflection.AmbiguousMatchException: Ambiguous match found.
    2.   at 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) [0x00050] in <202f8c081a504aa2940103428e3fd66b>:0
    3.   at 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) [0x00000] in <202f8c081a504aa2940103428e3fd66b>:0
    4.   at System.Type.GetMethod (System.String name, System.Reflection.BindingFlags bindingAttr) [0x0000e] in <202f8c081a504aa2940103428e3fd66b>:0
    5.   at System.Type.GetMethod (System.String name) [0x00000] in <202f8c081a504aa2940103428e3fd66b>:0
    6.   at GooglePlayServices.UnityCompat.GetUnity56AndAboveApplicationIdentifier (UnityEditor.BuildTarget buildTarget) [0x00000] in <6161ea2c3dc848909cf65dd754b884ec>:0
    7.   at GooglePlayServices.UnityCompat.GetApplicationId (UnityEditor.BuildTarget buildTarget) [0x00000] in <6161ea2c3dc848909cf65dd754b884ec>:0
    8.   at GooglePlayServices.PlayServicesResolver.GetAndroidApplicationId () [0x00000] in <6161ea2c3dc848909cf65dd754b884ec>:0
    9.   at GooglePlayServices.PlayServicesResolver.OnSettingsChanged () [0x00023] in <6161ea2c3dc848909cf65dd754b884ec>:0
    10.   at GooglePlayServices.PlayServicesResolver.Initialize () [0x00070] in <6161ea2c3dc848909cf65dd754b884ec>:0
    11.   at Google.EditorInitializer+<InitializeOnMainThread>c__AnonStorey1.<>m__2 () [0x00024] in <410925f9ec0e4665a3bd447b45d44b10>:0
    12. UnityEngine.Debug:LogError (object)
    13. Google.Logger:Log (string,Google.LogLevel)
    14. Google.EditorInitializer/<InitializeOnMainThread>c__AnonStorey1:<>m__2 ()
    15. Google.RunOnMainThread:ExecutePollingJobs ()
    16. Google.RunOnMainThread:<ExecuteAllUnnested>m__12 ()
    17. Google.RunOnMainThread:RunAction (System.Action)
    18. Google.RunOnMainThread:ExecuteAllUnnested (bool)
    19. Google.RunOnMainThread:ExecuteAll ()
    20. UnityEditor.EditorApplication:Internal_CallUpdateFunctions () (at /Users/bokken/buildslave/unity/build/Editor/Mono/EditorApplication.cs:356)
    21.  
     
  3. kyxap

    kyxap

    Joined:
    Aug 20, 2021
    Posts:
    8
    I've updated my project to 2021.2 and got this.
     
    appdex01 likes this.
  4. Gingerbeer

    Gingerbeer

    Joined:
    Aug 10, 2015
    Posts:
    24

    Attached Files:

    MetalCodeGames likes this.