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 #2241

Open
1 task done
wklimczykRASP opened this issue Jan 9, 2025 · 1 comment
Open
1 task done

Comments

@wklimczykRASP
Copy link

wklimczykRASP commented Jan 9, 2025

What happened?

App crashes in foreground on user's Galaxy Z Flip5.

Steps to reproduce?

Open/receive notification on "Galaxy Z Flip5"

What did you expect to happen?

Expected not to crash

OneSignal Android SDK version

Release 4.8.10

Android version

14

Specific Android models

* Galaxy Z Flip5

Relevant log output

Fatal Exception: android.view.WindowManager$BadTokenException: Unable to add window -- token android.view.ViewRootImpl$W@93a92f5 is not valid; is your activity running?
       at android.view.ViewRootImpl.setView(ViewRootImpl.java:1823)
       at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:600)
       at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:150)
       at android.widget.PopupWindow.invokePopup(PopupWindow.java:1721)
       at android.widget.PopupWindow.showAtLocation(PopupWindow.java:1421)
       at android.widget.PopupWindow.showAtLocation(PopupWindow.java:1387)
       at com.onesignal.InAppMessageView.createPopupWindow(InAppMessageView.java:327)
       at com.onesignal.InAppMessageView.access$900(InAppMessageView.java)
       at com.onesignal.InAppMessageView$2.run(InAppMessageView.java:271)
       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:9063)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:588)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)

Code of Conduct

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

Hello @wklimczykRASP, Thank you for sharing your stack trace. This issue has been fixed in our User Model 5.1.24. I recommend migrating to this SDK version, and you should see the issue resolved.

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

No branches or pull requests

2 participants