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

Could not show leak toast, the window token has been canceled #1095

Closed
tcqq opened this issue Sep 1, 2018 · 1 comment
Closed

Could not show leak toast, the window token has been canceled #1095

tcqq opened this issue Sep 1, 2018 · 1 comment

Comments

@tcqq
Copy link

tcqq commented Sep 1, 2018

Library version:

    debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.6.1'
    releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.1'
    // Optional, if you use support library fragments:
    debugImplementation 'com.squareup.leakcanary:leakcanary-support-fragment:1.6.1'

Error:

D/LeakCanary: Could not show leak toast, the window token has been canceled
    android.view.WindowManager$BadTokenException: Unable to add window -- token null 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 com.squareup.leakcanary.AndroidHeapDumper.show(AndroidHeapDumper.java:148)
        at com.squareup.leakcanary.AndroidHeapDumper.access$100(AndroidHeapDumper.java:43)
        at com.squareup.leakcanary.AndroidHeapDumper$1.run(AndroidHeapDumper.java:100)
        at android.os.Handler.handleCallback(Handler.java:873)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:193)
        at android.app.ActivityThread.main(ActivityThread.java:6669)
        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)
@JakeWharton
Copy link
Collaborator

Dupe of #1062

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