Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Specified cast is not valid error while using "SignInWithCredential". #326

Closed
remeesms opened this issue Oct 28, 2019 · 7 comments · Fixed by #333
Closed

Specified cast is not valid error while using "SignInWithCredential". #326

remeesms opened this issue Oct 28, 2019 · 7 comments · Fixed by #333
Assignees
Labels
in-progress Work is in progress
Projects

Comments

@remeesms
Copy link

remeesms commented Oct 28, 2019

While using "SignInWithCredential" the app is crashing with "Specified cast is not valid " error.
Its happening after updating the firebase auth to version="6.2.1". Previously The "SignInAndRetrieveDataWithCredential" was working perfect.

Firebase versions using:

  <package id="Xamarin.Firebase.iOS.Analytics" version="5.1.4.1" targetFramework="xamarinios10" />
  <package id="Xamarin.Firebase.iOS.Auth" version="6.2.1" targetFramework="xamarinios10" />
  <package id="Xamarin.Firebase.iOS.CloudMessaging" version="4.1.1.1" targetFramework="xamarinios10" />
  <package id="Xamarin.Firebase.iOS.Core" version="6.1.0" targetFramework="xamarinios10" />
  <package id="Xamarin.Firebase.iOS.Database" version="6.0.0" targetFramework="xamarinios10" />
  <package id="Xamarin.Firebase.iOS.InstanceID" version="4.2.1" targetFramework="xamarinios10" />
  <package id="Xamarin.Firebase.iOS.Storage" version="3.4.0" targetFramework="xamarinios10" />

Code Sample:

var credendtials = PhoneAuthProvider.DefaultInstance.GetCredential(verificationId, verificationCode);
Auth.DefaultInstance.SignInWithCredential(credential: credendtials, (task, error) =>
            {
                if (error != null)
                {                  
                    tcsPhone.SetResult(false);
                }
                else
                {
                    tcsPhone.SetResult(true);
                }

            });

Stack Trace error:

at (wrapper castclass) System.Object.__castclass_with_cache(object,intptr,intptr)\n at ObjCRuntime.Runtime.ConstructNSObject[T] (System.IntPtr ptr, System.Type type, ObjCRuntime.Runtime+MissingCtorResolution missingCtorResolution) [0x00050] in :0 \n at ObjCRuntime.Runtime.GetNSObject[T] (System.IntPtr ptr) [0x000d1] in :0 \n at ObjCRuntime.Trampolines+SDAuthResultHandler.Invoke (System.IntPtr block, System.IntPtr user, System.IntPtr error) [0x00016] in :0 \n at (wrapper native-to-managed) ObjCRuntime.Trampolines+SDAuthResultHandler.Invoke(intptr,intptr,intptr)\n at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)\n at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.4.0.2/src/Xamarin.iOS/UIKit/UIApplication.cs:86 \n at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0000e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.4.0.2/src/Xamarin.iOS/UIKit/UIApplication.cs:65 \n at Myapp.Touch.Application.Main (System.String[] args) [0x00001] in /Users/developeradmin/Myapp/Alpha8/Mobile/Sources/Myapp.Touch/Main.cs:9

@Redth Redth added this to Needs triage in Triage Oct 29, 2019
@remeesms
Copy link
Author

Any update on this?

@TonyPovey
Copy link

I'm also experiencing this same issue, although the login actually completes and if I restart the app then I'm logged in.

@remeesms
Copy link
Author

remeesms commented Nov 9, 2019

@TonyPovey Yeah same behaviour here. @Redth Any update?

@SotoiGhost SotoiGhost self-assigned this Nov 11, 2019
@SotoiGhost SotoiGhost added the investigating Currently investigating issue label Nov 11, 2019
SotoiGhost pushed a commit that referenced this issue Nov 12, 2019
@SotoiGhost SotoiGhost added in-progress Work is in progress and removed investigating Currently investigating issue labels Nov 12, 2019
@SotoiGhost SotoiGhost moved this from Needs triage to Low priority in Triage Nov 12, 2019
@SotoiGhost SotoiGhost moved this from Low priority to High priority in Triage Nov 12, 2019
@SotoiGhost
Copy link
Contributor

Guys, letting you know that a fix of this is in progress. Hope it will be released this week.

Triage automation moved this from High priority to Closed Nov 12, 2019
SotoiGhost pushed a commit that referenced this issue Nov 12, 2019
@remeesms
Copy link
Author

Now it doesn't show this error but there is no return from SignInWithCredential. Is there any change need in the implementation?

@SotoiGhost
Copy link
Contributor

@remeesms Nothing changed, we just changed the callback parameter type. If it seems to be failing, please, file a new issue describing the problem. Also, it would be great if you can provide a test case. Thanks in advance!

@remeesms
Copy link
Author

@SotoiGhost Filed a new issue here #337. Please have a look.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
in-progress Work is in progress
Projects
Triage
  
Closed
Development

Successfully merging a pull request may close this issue.

3 participants