Facebook is causing my activity to leak

2019-07-18 16:10发布

问题:

I'm using LeakCanary version 1.4-beta2 and I have just added Facebook sdk in my app. More precisely I have only added in MyApplication class this code in onCreate :

        FacebookSdk.sdkInitialize(getApplicationContext());

Yet I get this error from LeakCanary :

In css.demo.debug:1.0:1.
* css.demo.main.projects.ProjectsActivity has leaked:
* GC ROOT static com.facebook.appevents.internal.ActivityLifecycleTracker.currentFuture
* references java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.callable   * references java.util.concurrent.Executors$RunnableAdapter.task
* references com.facebook.appevents.internal.ActivityLifecycleTracker$4$1.this$0 (anonymous implementation of java.lang.Runnable)
* references com.facebook.appevents.internal.ActivityLifecycleTracker$4.val$activity (anonymous implementation of java.lang.Runnable)
* leaks css.demo.main.projects.ProjectsActivity instance

How should I deal with this problem ? Is there a problem somewhere in my code and I should investigate more or it has something to do with Facebook/LeakCanary code and I should file an issue?