dotMorten/MauiEx

Crash report from AutoSuggestBox on Android

Opened this issue · 0 comments

Description

AppCenter Crash Log:
AndroidAutoSuggestBox.set_IsSuggestionListOpen (System.Boolean value)
Java.Lang.RuntimeException: Unable to add window -- token null is not valid; is your activity running?

Steps to Reproduce

Not reproducible but I've seen it about 10 times

Expected Behavior

No crash!

Actual Behavior

This error message in crash log:

AndroidAutoSuggestBox.set_IsSuggestionListOpen (System.Boolean value)
Java.Lang.RuntimeException: Unable to add window -- token null is not valid; is your activity running?

JniEnvironment+InstanceMethods.CallNonvirtualVoidMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniObjectReference type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args)
JniPeerMembers+JniInstanceMethods.InvokeVirtualVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters)
AutoCompleteTextView.ShowDropDown ()
AndroidAutoSuggestBox.set_IsSuggestionListOpen (System.Boolean value)
AndroidAutoSuggestBox.OnFocusChanged (System.Boolean gainFocus, Android.Views.FocusSearchDirection direction, Android.Graphics.Rect previouslyFocusedRect)
View.n_OnFocusChanged_ZILandroid_graphics_Rect_ (System.IntPtr jnienv, System.IntPtr native__this, System.Boolean gainFocus, System.Int32 native_direction, System.IntPtr native_previouslyFocusedRect)
(wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.83(intptr,intptr,bool,int,intptr)
android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running?
android.view.ViewRootImpl.setView ViewRootImpl.java:1159
android.view.WindowManagerGlobal.addView WindowManagerGlobal.java:399
android.view.WindowManagerImpl.addView WindowManagerImpl.java:133
android.widget.PopupWindow.invokePopup PopupWindow.java:1576
android.widget.PopupWindow.showAsDropDown PopupWindow.java:1423
android.widget.ListPopupWindow.show ListPopupWindow.java:722
android.widget.AutoCompleteTextView.showDropDown AutoCompleteTextView.java:1317
crc6461e2ff30350109dc.AndroidAutoSuggestBox.n_onFocusChanged(Native Method)
crc6461e2ff30350109dc.AndroidAutoSuggestBox.onFocusChanged AndroidAutoSuggestBox.java:57
android.view.View.handleFocusGainInternal View.java:7779
android.view.View.requestFocusNoSearch View.java:13540
android.view.View.requestFocus View.java:13514
android.view.View.requestFocus View.java:13481
android.view.View.requestFocus View.java:13423
com.android.internal.policy.PhoneWindow.restoreHierarchyState PhoneWindow.java:2208
android.app.Activity.onRestoreInstanceState Activity.java:1724
android.app.Activity.performRestoreInstanceState Activity.java:1677
android.app.Instrumentation.callActivityOnRestoreInstanceState Instrumentation.java:1376
android.app.ActivityThread.handleStartActivity ActivityThread.java:3680
android.app.servertransaction.TransactionExecutor.performLifecycleSequence TransactionExecutor.java:221
android.app.servertransaction.TransactionExecutor.cycleToPath TransactionExecutor.java:201
android.app.servertransaction.TransactionExecutor.executeLifecycleState TransactionExecutor.java:173
android.app.servertransaction.TransactionExecutor.execute TransactionExecutor.java:97
android.app.ActivityThread$H.handleMessage ActivityThread.java:2214
android.os.Handler.dispatchMessage Handler.java:106
android.os.Looper.loopOnce Looper.java:201
android.os.Looper.loop Looper.java:288
android.app.ActivityThread.main ActivityThread.java:7842
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run RuntimeInit.java:548
com.android.internal.os.ZygoteInit.main ZygoteInit.java:1003

Basic Information

  • Version with issue: 1.1.1
  • Last known good version: Unknown
  • Platform Target Frameworks:
    • Android: Android 12
  • Android Support Library Version:
  • Nuget Packages: dotMorten.Xamarin.Forms.AutoSuggestBox
  • Affected Devices: Android 12, Pixel 3 XL (and others