Skip to content

WebAuthenticator crashes on first start of browser #24692

Open
@DonkeyKongJr

Description

@DonkeyKongJr

Description

The error appears occasionally in our AppCenter Diagnostics logs, but now it seems we have figured out the root cause. The WebAuthenticatorIntermediateActivity crashes with NullPointerException even when using Chrome as the default browser and for the login process. However, this only crashes on the first start of Chrome where the browser wants you to login with your google account. Typically we continue without the google sign-in and our login page appears. After we entered the credentials, this error appears. If we try to login again (from our app), Google opens up without that question and the login eventually succeeds.

WebAuthenticatorIntermediateActivity.onResume
WebAuthenticatorIntermediateActivity.java, line 41
Java.Lang.NullPointerException: Attempt to invoke virtual method 'boolean android.content.Intent.migrateExtraStreamToClipData(android.content.Context)' on a null object reference

Steps to Reproduce

  • Create a new Virtual Android Device
  • Select that device as Target
  • Start the debugger with that device
  • Start the login process
  • On the first start Google Chrome asks about your Google Account, proceed without the Google Accout
  • Login
  • Our app trows the NullPointerReference Exception

Link to public reproduction project repository

No response

Version with bug

8.0.80 SR8

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 11 and up

Did you find any workaround?

Well, if the user starts the login again, everything seems to be working fine.

Relevant log output

crc6468b6408a11370c2f.WebAuthenticatorIntermediateActivity.onResume
WebAuthenticatorIntermediateActivity.java, line 41
Java.Lang.NullPointerException: Attempt to invoke virtual method 'boolean android.content.Intent.migrateExtraStreamToClipData(android.content.Context)' on a null object reference

Stack Trace:
Java.Interop.JniEnvironment.InstanceMethods.CallNonvirtualVoidMethod(JniObjectReference , JniObjectReference , JniMethodInfo , JniArgumentValue* )
Java.Interop.JniPeerMembers.JniInstanceMethods.InvokeVirtualVoidMethod(String , IJavaPeerable , JniArgumentValue* )
Android.Content.ContextWrapper.StartActivity(Intent )
Microsoft.Maui.Authentication.WebAuthenticatorIntermediateActivity.OnResume()
Android.App.Activity.n_OnResume(IntPtr jnienv, IntPtr native__this)
Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PP_V(_JniMarshal_PP_V callback, IntPtr jnienv, IntPtr klazz)
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.content.Intent.migrateExtraStreamToClipData(android.content.Context)' on a null object reference
android.app.Instrumentation.execStartActivity Instrumentation.java:1871
android.app.Activity.startActivityForResult Activity.java:5838
android.app.Activity.startActivityForResult Activity.java:5796
android.app.Activity.startActivity Activity.java:6294
android.app.Activity.startActivity Activity.java:6261
crc6468b6408a11370c2f.WebAuthenticatorIntermediateActivity.n_onResume(Native Method)
crc6468b6408a11370c2f.WebAuthenticatorIntermediateActivity.onResume WebAuthenticatorIntermediateActivity.java:41
android.app.Instrumentation.callActivityOnResume Instrumentation.java:1603
android.app.Activity.performResume Activity.java:9084
android.app.ActivityThread.performResumeActivity ActivityThread.java:5534
android.app.ActivityThread.handleResumeActivity ActivityThread.java:5582
android.app.servertransaction.ResumeActivityItem.execute ResumeActivityItem.java:57
android.app.servertransaction.ActivityTransactionItem.execute ActivityTransactionItem.java:45
android.app.servertransaction.TransactionExecutor.executeLifecycleState TransactionExecutor.java:180
android.app.servertransaction.TransactionExecutor.execute TransactionExecutor.java:98
android.app.ActivityThread$H.handleMessage ActivityThread.java:2853
android.os.Handler.dispatchMessage Handler.java:108
android.os.Looper.loopOnce Looper.java:226
android.os.Looper.loop Looper.java:328
android.app.ActivityThread.main ActivityThread.java:9220
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run RuntimeInit.java:586
com.android.internal.os.ZygoteInit.main ZygoteInit.java:1099

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions