Java 泄漏了最初绑定到此处的ServiceConnection
我打开一个应用程序做了一些事情,但不知怎么的,应用程序崩溃了。我再次打开它,得到这个错误。我想知道这个错误的原因和解决方法。谁能帮忙吗Java 泄漏了最初绑定到此处的ServiceConnection,java,android,Java,Android,我打开一个应用程序做了一些事情,但不知怎么的,应用程序崩溃了。我再次打开它,得到这个错误。我想知道这个错误的原因和解决方法。谁能帮忙吗 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 origina
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)
15 01:25:59.698 31122-31122/com.myApp.myApp E/ActivityThread﹕ Activity com.myApp.myApp.Main已泄漏ServiceConnection com.google.android.gms.common。a@412XXfa8原来是订在这里的
android.app.ServiceConnection泄漏:Activity com.myApp.myApp.Main已泄漏ServiceConnection com.google.android.gms.common。a@412XXfa8原来是订在这里的
在android.app.LoadedApk$ServiceDispatcher上。(LoadedApk.java:969)
位于android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:863)
位于android.app.ContextImpl.bindService(ContextImpl.java:1470)
位于android.app.ContextImpl.bindService(ContextImpl.java:1459)
位于android.content.ContextWrapper.bindService(ContextWrapper.java:473)
在com.google.android.gms.ads.identifier.advisingidclient.h(未知来源)
在com.google.android.gms.ads.identifier.advisingiclient.b(未知来源)
在com.google.android.gms.ads.identifier.advisingidclient.getadvisingidinfo(未知来源)
位于java.lang.reflect.Method.Invokenactive(本机方法)
位于java.lang.reflect.Method.invoke(Method.java:511)
在com.facebook.internal.Utility.invokeMethod上(Utility.java:899)
在com.facebook.internal.attributeIdentifiers.getAndroid(attributeIdentifiers.java:85)
在com.facebook.internal.AttributeIdentifiers.GetAttributeIdentifiers(AttributeIdentifiers.java:110)上
位于com.facebook.AppEventsLogger.getSessionEventState(AppEventsLogger.java:751)
访问com.facebook.AppEventsLogger.access$600(AppEventsLogger.java:127)
登录com.facebook.AppEventsLogger$5.run(AppEventsLogger.java:708)
位于java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
位于java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
运行(Thread.java:856)
在onStop()或onDestroy()上解除服务连接的绑定
你找到解决办法了吗?
unBindService(connection);