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

fatal crash WindowManager$BadTokenException #99

Closed
tingsu opened this issue Jun 14, 2020 · 4 comments
Closed

fatal crash WindowManager$BadTokenException #99

tingsu opened this issue Jun 14, 2020 · 4 comments

Comments

@tingsu
Copy link

tingsu commented Jun 14, 2020

Some steps:

  1. go to the google play store by clicking the notification of updating google play services
  2. do not update google play services and go back to SwissCovid
  3. a message shows and indicate some error happens

Info

  • Android 9.0
  • SwissCovid App Version 1.0.3-pilot (Installed by Google Play Store)

Stack trace:

 FATAL EXCEPTION: main
 Process: ch.admin.bag.dp3t, PID: 5480
 android.view.WindowManager$BadTokenException: Unable to add window -- token android.os.BinderProxy@e477c90 is not valid; is your activity running?
 	at android.view.ViewRootImpl.setView(ViewRootImpl.java:798)
 	at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:356)
 	at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:93)
 	at android.app.Dialog.show(Dialog.java:329)
 	at androidx.appcompat.app.AlertDialog$Builder.show(AlertDialog.java:2)
 	at ch.admin.bag.dp3t.onboarding.OnboardingGaenPermissionFragment.lambda$activateGaen$6$OnboardingGaenPermissionFragment(OnboardingGaenPermissionFragment.java:8)
 	at ch.admin.bag.dp3t.onboarding.-$$Lambda$OnboardingGaenPermissionFragment$f6FWUcdwgeIQm3y4Wpr0_QpGNdA.accept(Unknown Source:6)
 	at org.dpppt.android.sdk.DP3T.lambda$start$1(DP3T.java:2)
 	at org.dpppt.android.sdk.-$$Lambda$DP3T$UVi9w5byNHCGNiVf9VXIkFjhUds.accept(Unknown Source:4)
 	at org.dpppt.android.sdk.internal.nearby.GoogleExposureClient.lambda$start$1(GoogleExposureClient.java:10)
 	at org.dpppt.android.sdk.internal.nearby.-$$Lambda$GoogleExposureClient$S_GvBtY43IrGwB3bGO6kWKBQPXg.onFailure(Unknown Source:6)
 	at com.google.android.gms.tasks.zzl.run(com.google.android.gms:play-services-tasks@@17.0.2:8)
 	at android.os.Handler.handleCallback(Handler.java:873)
 	at android.os.Handler.dispatchMessage(Handler.java:99)
 	at com.google.android.gms.internal.tasks.zzb.dispatchMessage(com.google.android.gms:play-services-tasks@@17.0.2:1)
 	at android.os.Looper.loop(Looper.java:193)
 	at android.app.ActivityThread.main(ActivityThread.java:6718)
 	at java.lang.reflect.Method.invoke(Native Method)
 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

Another similar stack trace (probably pointing to the same issue):

 FATAL EXCEPTION: main
 Process: ch.admin.bag.dp3t, PID: 2725
 android.view.WindowManager$BadTokenException: Unable to add window -- token android.os.BinderProxy@de870c1 is not valid; is your activity running?
 	at android.view.ViewRootImpl.setView(ViewRootImpl.java:798)
 	at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:356)
 	at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:93)
 	at android.app.Dialog.show(Dialog.java:329)
 	at androidx.appcompat.app.AlertDialog$Builder.show(AlertDialog.java:2)
 	at ch.admin.bag.dp3t.contacts.ContactsFragment.lambda$null$5$ContactsFragment(ContactsFragment.java:8)
 	at ch.admin.bag.dp3t.contacts.-$$Lambda$ContactsFragment$WLiQ3J9D74Mg5Gi8M1uwTrjbJnc.accept(Unknown Source:6)
 	at org.dpppt.android.sdk.DP3T.lambda$start$1(DP3T.java:2)
 	at org.dpppt.android.sdk.-$$Lambda$DP3T$UVi9w5byNHCGNiVf9VXIkFjhUds.accept(Unknown Source:4)
 	at org.dpppt.android.sdk.internal.nearby.GoogleExposureClient.lambda$start$1(GoogleExposureClient.java:10)
 	at org.dpppt.android.sdk.internal.nearby.-$$Lambda$GoogleExposureClient$S_GvBtY43IrGwB3bGO6kWKBQPXg.onFailure(Unknown Source:6)
 	at com.google.android.gms.tasks.zzl.run(com.google.android.gms:play-services-tasks@@17.0.2:8)
 	at android.os.Handler.handleCallback(Handler.java:873)
 	at android.os.Handler.dispatchMessage(Handler.java:99)
 	at com.google.android.gms.internal.tasks.zzb.dispatchMessage(com.google.android.gms:play-services-tasks@@17.0.2:1)
 	at android.os.Looper.loop(Looper.java:193)
 	at android.app.ActivityThread.main(ActivityThread.java:6718)
 	at java.lang.reflect.Method.invoke(Native Method)
 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
@simonroesch
Copy link
Contributor

Can you please provide a screenshot of the error when you come back to the app?

@tingsu
Copy link
Author

tingsu commented Jun 19, 2020

Hi @simonroesch , I may not be able to provide the screenshot anymore. The reason is that I already updated my Google Play services. As a result, the notification of asking me to update the Google Play Services will not appear anymore. I cannot reproduce this issue unless I degrade my Google Play Services on my phone. Before this, I indeed encountered this reported issue.

From the crash stack, I guess the issue may reside in the org.dpppt.android.sdk when handling fragments.

@simonroesch
Copy link
Contributor

I tried to reproduce this on a phone with Android 9 and degraded Google PlayServices, but I am not able to reproduce it. Also with having the developer option "Don't keep activities".

@simonroesch
Copy link
Contributor

I will close this issue, please reopen if this can be reproduced with version 1.0.4-pilot or later.

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

2 participants