【问题标题】:leaked ServiceConnection that was originally bound here泄露了原本绑定在这里的ServiceConnection
【发布时间】:2015-01-14 20:30:58
【问题描述】:

我打开一个应用程序做某事,应用程序以某种方式崩溃。我再次打开它并收到此错误。我想知道这个错误的原因和解决方法。谁能帮忙。

   15 01:25:59.698  31122-31122/com.myApp.myApp E/ActivityThread﹕ Activity com.myApp.myApp.Main has leaked ServiceConnection com.google.android.gms.common.a@412XXfa8 that was originally bound here
    android.app.ServiceConnectionLeaked: Activity com.myApp.myApp.Main has leaked ServiceConnection com.google.android.gms.common.a@412XXfa8 that was originally bound here
            at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:969)
            at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:863)
            at android.app.ContextImpl.bindService(ContextImpl.java:1470)
            at android.app.ContextImpl.bindService(ContextImpl.java:1459)
            at android.content.ContextWrapper.bindService(ContextWrapper.java:473)
            at com.google.android.gms.ads.identifier.AdvertisingIdClient.h(Unknown Source)
            at com.google.android.gms.ads.identifier.AdvertisingIdClient.b(Unknown Source)
            at com.google.android.gms.ads.identifier.AdvertisingIdClient.getAdvertisingIdInfo(Unknown Source)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at com.facebook.internal.Utility.invokeMethodQuietly(Utility.java:899)
            at com.facebook.internal.AttributionIdentifiers.getAndroidId(AttributionIdentifiers.java:85)
            at com.facebook.internal.AttributionIdentifiers.getAttributionIdentifiers(AttributionIdentifiers.java:110)
            at com.facebook.AppEventsLogger.getSessionEventsState(AppEventsLogger.java:751)
            at com.facebook.AppEventsLogger.access$600(AppEventsLogger.java:127)
            at com.facebook.AppEventsLogger$5.run(AppEventsLogger.java:708)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
            at java.lang.Thread.run(Thread.java:856)

【问题讨论】:

  • 您找到了解决方案?
  • 你好@Maven,你找到解决方案了吗?

标签: java android


【解决方案1】:

在 onStop() 或 onDestroy() 处取消绑定您的服务连接

unBindService(connection);

【讨论】:

    猜你喜欢
    • 2013-11-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-11-24
    • 1970-01-01
    • 2010-12-31
    • 1970-01-01
    相关资源
    最近更新 更多