Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unity exception with 2022.3.18 ambigouous reference while UnityInitializer script on android device. IOS and editor is working fine. #3568

Open
1 task
FarhanIshfaq opened this issue Dec 6, 2024 · 5 comments
Labels
bug This issue is a bug. module/unity needs-review p3 This is a minor priority issue

Comments

@FarhanIshfaq
Copy link

Describe the bug

mbiguousMatchException: 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 <00000000000000000000000000000000>: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 <00000000000000000000000000000000>:0)
Amazon.Util.Internal.AndroidInterop.GetStaticJavaField[T] (System.String className, System.String methodName) (at <00000000000000000000000000000000>:0)
Amazon.Util.Internal.AmazonHookedPlatformInfo.Init () (at <00000000000000000000000000000000>:0)
Amazon.Util.Internal.AmazonHookedPlatformInfo.get_Instance () (at <00000000000000000000000000000000>:0)
Amazon.UnityInitializer.Awake () (at <00000000000000000000000000000000>:0)
UnityEngine.GameObject.AddComponent[T] () (at <00000000000000000000000000000000>:0)
Amazon.UnityInitializer.AttachToGameObject (UnityEngine.GameObject gameObject) (at <00000000000000000000000000000000>:0)
AWSManager.Initialize (System.String gToken) (at <00000000000000000000000000000000>:0)
Bootstrap.InitializeGoogleDependencies (Assets.SimpleGoogleSignIn.Scripts.UserInfo user, System.String googleToken) (at <00000000000000000000000000000000>:0)
Bootstrap+d__20.MoveNext () (at <00000000000000000000000000000000>:0)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <00000000000000000000000000000000>:0)
UnityEngine.GameObject:AddComponent()
Amazon.UnityInitializer:AttachToGameObject(GameObject)
AWSManager:Initialize(String)
Bootstrap:InitializeGoogleDependencies(UserInfo, String)
d__20:MoveNext()
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

I'm gettting this exception on android device while calling the : Amazon.UnityInitializer.AttachToGameObject(gameObject);

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

Should not throw exception.

Current Behavior

mbiguousMatchException: 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 <00000000000000000000000000000000>: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 <00000000000000000000000000000000>:0)
Amazon.Util.Internal.AndroidInterop.GetStaticJavaField[T] (System.String className, System.String methodName) (at <00000000000000000000000000000000>:0)
Amazon.Util.Internal.AmazonHookedPlatformInfo.Init () (at <00000000000000000000000000000000>:0)
Amazon.Util.Internal.AmazonHookedPlatformInfo.get_Instance () (at <00000000000000000000000000000000>:0)
Amazon.UnityInitializer.Awake () (at <00000000000000000000000000000000>:0)
UnityEngine.GameObject.AddComponent[T] () (at <00000000000000000000000000000000>:0)
Amazon.UnityInitializer.AttachToGameObject (UnityEngine.GameObject gameObject) (at <00000000000000000000000000000000>:0)
AWSManager.Initialize (System.String gToken) (at <00000000000000000000000000000000>:0)
Bootstrap.InitializeGoogleDependencies (Assets.SimpleGoogleSignIn.Scripts.UserInfo user, System.String googleToken) (at <00000000000000000000000000000000>:0)
Bootstrap+d__20.MoveNext () (at <00000000000000000000000000000000>:0)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <00000000000000000000000000000000>:0)
UnityEngine.GameObject:AddComponent()
Amazon.UnityInitializer:AttachToGameObject(GameObject)
AWSManager:Initialize(String)
Bootstrap:InitializeGoogleDependencies(UserInfo, String)
d__20:MoveNext()
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

Reproduction Steps

Just use : Amazon.UnityInitializer.AttachToGameObject(gameObject);

Possible Solution

To Work Fine with init.

Additional Information/Context

No

AWS .NET SDK and/or Package version used

AWSSDK unity updated.

Targeted .NET Platform

.Net 2.1

Operating System and version

Android.

@FarhanIshfaq FarhanIshfaq added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Dec 6, 2024
@ashishdhingra ashishdhingra added module/unity p3 This is a minor priority issue labels Dec 6, 2024
@ashishdhingra
Copy link
Contributor

@FarhanIshfaq Good morning. Please refer AmbiguousMatchException; the AmbiguousMatchException is thrown when a member is invoked late-bound and multiple overloads satisfy the binding criteria, or when more than one member matches the binding criteria passed to a reflection method that can return only a single result. Please check your project file if it's attempting to load multiple assemblies containing similar type definition for Android target.

Also refer Special considerations for Unity support for guidance on how to use AWSSDK assemblies in your Unity application.

I found an article on Unity forums Why do I get Error: Ambiguous Match Found (Non-Mediation PSR in use)? providing resolution for similar issue, if that helps.

Thanks,
Ashish

@ashishdhingra ashishdhingra added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed needs-triage This issue or PR still needs to be triaged. labels Dec 6, 2024
@FarhanIshfaq
Copy link
Author

FarhanIshfaq commented Dec 6, 2024 via email

@ashishdhingra ashishdhingra added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. labels Dec 6, 2024
@FarhanIshfaq
Copy link
Author

FarhanIshfaq commented Dec 6, 2024 via email

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Dec 7, 2024
@ashishdhingra
Copy link
Contributor

they just make auth with
cognito but i can't make dataset to amazon cognito to sync user data with
amazon cognito because in these dll's there is no class reference for
saving the data on cognito

@FarhanIshfaq Good morning. Could you please elaborate your scenario? Looks like the original issue is resolved by using NET Standard 2.1 DLLs. what are you trying to sync with Cognito? And which class reference are you looking for? Have you tried using AWSSDK.CognitoSync DLL included in https://sdk-for-net.amazonwebservices.com/latest/v3/aws-sdk-netstandard2.0.zip?

Thanks,
Ashish

@ashishdhingra ashishdhingra added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Dec 10, 2024
@FarhanIshfaq
Copy link
Author

they just make auth with
cognito but i can't make dataset to amazon cognito to sync user data with
amazon cognito because in these dll's there is no class reference for
saving the data on cognito

@FarhanIshfaq Good morning. Could you please elaborate your scenario? Looks like the original issue is resolved by using NET Standard 2.1 DLLs. what are you trying to sync with Cognito? And which class reference are you looking for? Have you tried using AWSSDK.CognitoSync DLL included in https://sdk-for-net.amazonwebservices.com/latest/v3/aws-sdk-netstandard2.0.zip?

Thanks, Ashish

Yes i did use these sdk too but i didn't find CognitoSync.SyncManger file reference can you please guide a little how i can sync data on amazon cognito using these sdk on.

Thanks for the reponse.

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. module/unity needs-review p3 This is a minor priority issue
Projects
None yet
Development

No branches or pull requests

2 participants