FirebaseUI-Android
FirebaseUI-Android copied to clipboard
Unable to add window -- token null is not valid; is your activity running?
Welcome to FirebaseUI and thanks for submitting an issue!
Please take a look at open issues, as well as resolved issues, to see if your issue is either already being addressed, or has been solved by someone else.
If not, please feel free to fill in the following info so we can help faster!
Step 1: Are you in the right place?
Yes
Step 2: Describe your environment
- Android device: Nexus 5X
- Android OS version: 6.0.1
- Google Play Services version: 4.3.13
- Firebase/Play Services SDK version: 21.0.6
- FirebaseUI version: 8.0.1
Step 3: Describe the problem:
Running the app that uses Firebase UI (Phone Auth) with Firebase Test Lab, there is an intermittent issue with country list. I never encounter this issue personally thus I am not sure how to exactly reproduce it and I don't see any issue on the Test matrix video.
Steps to reproduce:
N/A
Observed Results:
CountryListSpinner.java line 109
com.firebase.ui.auth.ui.phone.CountryListSpinner.onFocus
Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.sample.app/com.firebase.ui.auth.ui.phone.PhoneActivity}: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running?
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5421)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running?
at android.view.ViewRootImpl.setView(ViewRootImpl.java:567)
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:310)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:85)
at android.widget.PopupWindow.invokePopup(PopupWindow.java:1258)
at android.widget.PopupWindow.showAsDropDown(PopupWindow.java:1110)
at androidx.appcompat.widget.AppCompatPopupWindow.showAsDropDown(AppCompatPopupWindow.java:77)
at androidx.core.widget.PopupWindowCompat$Api19Impl.showAsDropDown(PopupWindowCompat.java:247)
at androidx.core.widget.PopupWindowCompat.showAsDropDown(PopupWindowCompat.java:71)
at androidx.appcompat.widget.ListPopupWindow.show(ListPopupWindow.java:757)
at com.firebase.ui.auth.ui.phone.CountryListSpinner.onFocus(CountryListSpinner.java:109)
at com.firebase.ui.auth.ui.phone.CountryListSpinner.onFocusChanged(CountryListSpinner.java:101)
at android.view.View.handleFocusGainInternal(View.java:5478)
at android.view.View.requestFocusNoSearch(View.java:8476)
at android.view.View.requestFocus(View.java:8455)
at android.view.View.requestFocus(View.java:8422)
at android.view.View.requestFocus(View.java:8401)
at com.android.internal.policy.PhoneWindow.restoreHierarchyState(PhoneWindow.java:2043)
at android.app.Activity.onRestoreInstanceState(Activity.java:1008)
at android.app.Activity.performRestoreInstanceState(Activity.java:963)
at android.app.Instrumentation.callActivityOnRestoreInstanceState(Instrumentation.java:1163)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2389)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5421)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Expected Results:
No error