I am using Xamarin.Auth and OAuth2Authenticator for login. At times, I am receiving infinite authentication error popups. From the app center crashlytics, I am receiving the following exception message: Java.Lang.RuntimeException: Could not read input channel file descriptors from parcel.
JniEnvironment+InstanceMethods.CallVoidMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) JniPeerMembers+JniInstanceMethods.InvokeVirtualVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) Dialog.Show () ActivityEx.ShowError (Android.App.Activity activity, System.String title, System.String message) ActivityEx.ShowError (Android.App.Activity activity, System.String title, System.Exception exception) WebAuthenticatorActivity.<OnCreate>b__4_1 (System.Object s, Xamarin.Auth.AuthenticatorErrorEventArgs e) Authenticator+<>c__DisplayClass32_0.<RaiseErrorEvent>b__0 () Thread+RunnableImplementor.Run () IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) (wrapper dynamic-method) System.Object.49(intptr,intptr) java.lang.RuntimeException: Could not read input channel file descriptors from parcel. android.view.InputChannel.nativeReadFromParcel(Native Method) android.view.InputChannel.readFromParcel InputChannel.java:148 android.view.IWindowSession$Stub$Proxy.addToDisplay IWindowSession.java:804 android.view.ViewRootImpl.setView ViewRootImpl.java:737 android.view.WindowManagerGlobal.addView WindowManagerGlobal.java:359 android.view.WindowManagerImpl.addView WindowManagerImpl.java:94 android.app.Dialog.show Dialog.java:330 mono.java.lang.RunnableImplementor.n_run(Native Method) mono.java.lang.RunnableImplementor.run RunnableImplementor.java:30 android.app.Activity.runOnUiThread Activity.java:6201 mono.java.lang.RunnableImplementor.n_run(Native Method) mono.java.lang.RunnableImplementor.run RunnableImplementor.java:30 android.os.Handler.handleCallback Handler.java:790 android.os.Handler.dispatchMessage Handler.java:99 android.os.Looper.loop Looper.java:164 android.app.ActivityThread.main ActivityThread.java:6528 java.lang.reflect.Method.invoke(Native Method) com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run RuntimeInit.java:438 com.android.internal.os.ZygoteInit.main ZygoteInit.java:807
I am assuming that the above app crash is taking place because of the infinite popups. Need some help regarding this.
Code snippet for Authentication error:
private async void AuthenticationError(object sender, AuthenticatorErrorEventArgs e) { var authenticator = sender as OAuth2Authenticator; if (authenticator != null) { authenticator.Completed -= async (_sender, _e) => await AuthenticationCompleted(_sender, _e); authenticator.Error -= AuthenticationError; } }
Answers
Cancel the
authenticator
should be able to solve the problem .Check https://forums.xamarin.com/discussion/comment/294208/#Comment_294208 .