当前位置:   article > 正文

Unity接入Google登录,踩坑_ambiguousmatchexception: ambiguous match found.

ambiguousmatchexception: ambiguous match found.

记录不明坑

根据大佬们写的文章Unity接入Google登录超详细流程接入Google,但是在导入安卓依赖管理插件EDM4U后,却疯狂报错。

刚开始是:

Assembly 'Assets/ExternalDependencyManager/Editor/Google.VersionHandlerImpl_v1.2.157.dll' will not be loaded due to errors: Assembly name 'Google.VersionHandlerImpl' does not match file name 'Google.VersionHandlerImpl_v1.2.157'

原因是程序集跟文件名不匹配,把Google.VersionHandlerImpl_v1.2.157的版本后缀删掉就好啦

后面又有一个报错:

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 <88e4733ac7bc4ae1b496735e6b83bbd3>:0) System.RuntimeType.GetMethodImpl...

这个似乎是 由于反射(Reflection)库在查找方法时出现了歧义(AmbiguousMatch)而导致的,例如在查找方法时,发现有多个方法名称相同且参数类型也相同的方法。这种情况下,反射库无法确定要调用哪个方法,因此会抛出 AmbiguousMatchException 异常。

找了很久,没找到解决的方法,最终的解决方法是删掉了安卓依赖管理里面的Google.IOSResolver跟Google.JarResolver,手动注册安卓依赖,最终解决了...

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/羊村懒王/article/detail/706971
推荐阅读