Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: android.view.WindowManager$BadTokenException - Unable to add window #2014

Open
1 task done
albertoderodrigo opened this issue Mar 4, 2024 · 8 comments
Open
1 task done

Comments

@albertoderodrigo
Copy link

What happened?

I see this error on firebase from your SDK

Fatal Exception: android.view.WindowManager$BadTokenException
Unable to add window -- token android.os.BinderProxy@8c472c5 is not valid; is your activity running?

This could help https://stackoverflow.com/questions/7811993/error-binderproxy45d459c0-is-not-valid-is-your-activity-running

Full log:

io.socialgamesonline.slotcom_issue_e128821ca7d4cb21571b73e42c6bd165_crash_session_65E5B6C4004300016D57E2D4CA33E9FD_DNE_0_v2_stacktrace.txt

Steps to reproduce?

We are unable to reproduce it manually

What did you expect to happen?

No errors

OneSignal Android SDK version

5.1.6

Android version

13, 12

Specific Android models

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@jennantilla
Copy link
Contributor

@albertoderodrigo thank you for reporting; we'll look into this.

@yosefBazaart
Copy link

yosefBazaart commented Mar 7, 2024

same here, only see it in Google's Play store vitals.
this is our top crash so please fix it.

Exception android.view.WindowManager$BadTokenException:
  at android.view.ViewRootImpl.setView (ViewRootImpl.java:1743)
  at android.view.WindowManagerGlobal.addView (WindowManagerGlobal.java:524)
  at android.view.WindowManagerImpl.addView (WindowManagerImpl.java:150)
  at android.app.Dialog.show (Dialog.java:512)
  at android.app.AlertDialog$Builder.show (AlertDialog.java:1153)
  at com.onesignal.core.internal.permissions.AlertDialogPrepromptForAndroidSettings.show (AlertDialogPrepromptForAndroidSettings.kt)
  at com.onesignal.notifications.internal.permissions.impl.NotificationPermissionController.showFallbackAlertDialog (NotificationPermissionController.kt)
  at com.onesignal.notifications.internal.permissions.impl.NotificationPermissionController.onReject (NotificationPermissionController.kt)
  at com.onesignal.core.activities.PermissionsActivity.onRequestPermissionsResult$lambda-0 (PermissionsActivity.kt)
  at android.os.Handler.handleCallback (Handler.java:958)
  at android.os.Handler.dispatchMessage (Handler.java:99)
  at android.os.Looper.loopOnce (Looper.java:230)
  at android.os.Looper.loop (Looper.java:319)
  at android.app.ActivityThread.main (ActivityThread.java:8893)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:608)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1103)

@yosefBazaart
Copy link

any news? this is our number 1 crash. please fix it.

@KChernenko
Copy link

We faced the same problem, and it's our number 1 crash as well (application with millions of active users).
@jennantilla any updates on this?

@marclucraft
Copy link

Can you confirm whether you have tried updating to the latest release, and if the issues persist?

Have you also reviewed #2048?

@KChernenko
Copy link

@marclucraft, we are using version 5.1.8. The fix for this issue is not mentioned in the changelog for 5.1.9.

@mrRedSun
Copy link

mrRedSun commented May 2, 2024

We receive many bug reports like this:

Stack trace

Fatal Exception: android.view.WindowManager$BadTokenException: Unable to add window -- token android.os.BinderProxy@316ca97 is not valid; is your activity running?
       at android.view.ViewRootImpl.setView(ViewRootImpl.java:1508)
       at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:426)
       at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:150)
       at android.app.Dialog.show(Dialog.java:370)
       at android.app.AlertDialog$Builder.show(AlertDialog.java:1137)
       at com.onesignal.core.internal.permissions.AlertDialogPrepromptForAndroidSettings.show(AlertDialogPrepromptForAndroidSettings.java:112)
       at com.onesignal.notifications.internal.permissions.impl.NotificationPermissionController.showFallbackAlertDialog(NotificationPermissionController.java:39)
       at com.onesignal.notifications.internal.permissions.impl.NotificationPermissionController.onReject(NotificationPermissionController.java:2)
       at com.onesignal.core.activities.PermissionsActivity.onRequestPermissionsResult$lambda-0(PermissionsActivity.java:76)
       at android.os.Handler.handleCallback(Handler.java:958)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loopOnce(Looper.java:257)
       at android.os.Looper.loop(Looper.java:368)
       at android.app.ActivityThread.main(ActivityThread.java:8826)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:572)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1049)

Currently running 5.1.3, upgraded to 5.1.6, will let you know if this is not resolved, and hopefully won't forget to tell you that it is

sooraj-r-pai added a commit to sooraj-r-pai/OneSignal-Android-SDK that referenced this issue May 3, 2024
@yosefBazaart
Copy link

running 5.1.9 and still happens

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants