lupidan / apple-signin-unity

Unity plugin to support Sign In With Apple Id
MIT License
598 stars 85 forks source link

Ambiguous call on `AddSignInWithAppleWithCompatibility` #200

Closed RaphaelNSG closed 5 months ago

RaphaelNSG commented 6 months ago

I'm using Unity's version 2021.3.27f1 and updated the plugin to version 1.4.3 but now Unity is complaining about an ambiguous error:

Assets/AppleAuthSample/Editor/SignInWithApplePostprocessor.cs(29,33): error CS0121: The call is ambiguous between the following methods or properties: 
'AppleAuth.Editor.ProjectCapabilityManagerExtension.AddSignInWithAppleWithCompatibility(UnityEditor.iOS.Xcode.ProjectCapabilityManager, string)' and 
'UnityEditor.iOS.Xcode.ProjectCapabilityManagerExtension.AddSignInWithAppleWithCompatibility(UnityEditor.iOS.Xcode.ProjectCapabilityManager, string)'
MrVeit commented 5 months ago

Hi, I've been facing this as well! You better wrap this in your Post Proccess Build method in #if UNITY_IOS directive, otherwise it will still react on it when the current build platform is selected not IOS.

dmitrykurteanu commented 5 months ago

I'm using Unity's version 2021.3.27f1 and updated the plugin to version 1.4.3 but now Unity is complaining about an ambiguous error:

Assets/AppleAuthSample/Editor/SignInWithApplePostprocessor.cs(29,33): error CS0121: The call is ambiguous between the following methods or properties: 
'AppleAuth.Editor.ProjectCapabilityManagerExtension.AddSignInWithAppleWithCompatibility(UnityEditor.iOS.Xcode.ProjectCapabilityManager, string)' and 
'UnityEditor.iOS.Xcode.ProjectCapabilityManagerExtension.AddSignInWithAppleWithCompatibility(UnityEditor.iOS.Xcode.ProjectCapabilityManager, string)'

I had that same issue and I found out I already had a script in my Scripts/Editor/ folder that was adding that AddSignInWithAppleWithCompatibility extension method. I can't remember where it came from, probably from a different AppleSignIn plugin I've tried earlier. Since this plugin comes with its own version located at Assets\AppleAuth\Editor\ProjectCapabilityManagerExtension.cs, it results in an ambiguous call.

lupidan commented 5 months ago

Just tested precisely 2021.3.27f1

Checked built-in Unity's UnityEditor.iOS.Xcode library, it did not contain any class or namespace named ProjectCapabilityManagerExtension.

Screenshot 2024-04-21 at 14 49 18

Also, in the provided code, the namespace is clearly named AppleAuth.Editor https://github.com/lupidan/apple-signin-unity/blob/d4296dba75e5c4f2457200cd30577ee421b43e56/AppleAuth/Editor/ProjectCapabilityManagerExtension.cs#L7-L9

To me this looks like this is an issue with your particular setup. You probably have a copy of that file, with the namespace changed for whatever reason.

Closing