应用程序崩溃是因为" ServiceConnectionLeaked"

时间:2015-06-21 06:29:19

标签: android crash

我在我的应用程序中添加了几个按钮并再次运行它,并在完成一次运行后崩溃。我不知道是什么带来的,但这是调试模式中的以下错误:

06-20 23:21:59.656    2323-2323/com.android.email E/ActivityThread﹕ Service com.android.email.service.EmailBroadcastProcessorService has leaked ServiceConnection com.android.emailcommon.service.ServiceProxy$ProxyConnection@2ded40e8 that was originally bound here
android.app.ServiceConnectionLeaked: Service com.android.email.service.EmailBroadcastProcessorService has leaked ServiceConnection com.android.emailcommon.service.ServiceProxy$ProxyConnection@2ded40e8 that was originally bound here
        at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:1077)
        at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:971)
        at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:1774)
        at android.app.ContextImpl.bindService(ContextImpl.java:1757)
        at android.content.ContextWrapper.bindService(ContextWrapper.java:539)
        at com.android.emailcommon.service.ServiceProxy.setTask(ServiceProxy.java:181)
        at com.android.emailcommon.service.ServiceProxy.test(ServiceProxy.java:224)
        at com.android.email.service.EmailServiceUtils.isServiceAvailable(EmailServiceUtils.java:160)
        at com.android.email.provider.AccountReconciler.reconcileAccountsInternal(AccountReconciler.java:171)
        at com.android.email.provider.AccountReconciler.reconcileAccounts(AccountReconciler.java:115)
        at com.android.email.service.EmailBroadcastProcessorService.reconcileAndStartServices(EmailBroadcastProcessorService.java:305)
        at com.android.email.service.EmailBroadcastProcessorService.onBootCompleted(EmailBroadcastProcessorService.java:295)
        at com.android.email.service.EmailBroadcastProcessorService.onHandleIntent(EmailBroadcastProcessorService.java:130)
        at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:135)
        at android.os.HandlerThread.run(HandlerThread.java:61)

所以我点击了第一个LoadedApk(我没有修改) 这是我看到的代码

        ServiceDispatcher(ServiceConnection conn,
            Context context, Handler activityThread, int flags) {
        mIServiceConnection = new InnerConnection(this);
        mConnection = conn;
        mContext = context;
        mActivityThread = activityThread;
        mLocation = new ServiceConnectionLeaked(null);
        mLocation.fillInStackTrace();
        mFlags = flags;
    }

阅读后,我怀疑这可能是一个记忆问题,但我不太确定。在记忆中,它通常分配~22mb和〜1mb free。

1 个答案:

答案 0 :(得分:0)

这可能是未在清单中声明您的(活动之一)activity.xml对应类的原因之一。

<activity android:name=".ValidatorDemo">
    </activity>




public class Validatordemo extends Activity{
     .....
}