LeakActivity Leaked 在 Leak Canary 上显示

LeakActivity Leaked showing on Leak Canary

这个 activity 不是我的应用程序的一部分,它一直显示在 Leak Canary 应用程序上。

它甚至似乎与 activity 我 运行 以及我是否打开应用程序完全无关。

我在过去 12 小时内收到此消息总共 6 次

谁能帮忙解释一下?

LibraryLeak(className=leakcanary.internal.activity.LeakActivity, leakTrace=
┬
├─ android.view.ViewGroup$ViewLocationHolder
│    Leaking: NO (a class is never leaking)
│    GC Root: System class
│    ↓ static ViewGroup$ViewLocationHolder.sPool
│                                          ~~~~~
├─ android.util.Pools$SynchronizedPool
│    Leaking: UNKNOWN
│    ↓ Pools$SynchronizedPool.mPool
│                             ~~~~~
├─ java.lang.Object[]
│    Leaking: UNKNOWN
│    ↓ array Object[].[0]
│                     ~~~
├─ android.view.ViewGroup$ViewLocationHolder
│    Leaking: UNKNOWN
│    ↓ ViewGroup$ViewLocationHolder.mRoot
│                                   ~~~~~
├─ android.widget.ListView
│    Leaking: YES (View.mContext references a destroyed activity)
│    mContext instance of leakcanary.internal.activity.LeakActivity with mDestroyed = true
│    View#mParent is set
│    View#mAttachInfo is null (view detached)
│    View.mWindowAttachCount = 1
│    ↓ ListView.mContext
╰→ leakcanary.internal.activity.LeakActivity
​     Leaking: YES (ListView↑ is leaking and Activity#mDestroyed is true and ObjectWatcher was watching this)
​     key = 53dca871-cc9b-4735-a0fd-98d21465fce0
​     watchDurationMillis = 14202
​     retainedDurationMillis = 9201
, retainedHeapByteSize=132349, pattern=instance field android.view.ViewGroup$ViewLocationHolder#mRoot, description=In Android P, ViewLocationHolder has an mRoot field that is not cleared in its clear() method. Introduced in https://github.com/aosp-mirror/platform_frameworks_base/commit/86b326012813f09d8f1de7d6d26c986a909d Bug report: https://issuetracker.google.com/issues/112792715)```

这是 Android 框架 (ViewGroup.ViewLocationHolder) 中的已知漏洞:https://github.com/square/leakcanary/issues/1081

LeakCanary 实际上是这样识别它的,这就是它被报告为 "LibraryLeak" 的原因。请参阅该线程以了解可能修复它的方法(这很难,因为它是 android 框架中的错误)。