【问题标题】:App Crashes because of "ServiceConnectionLeaked"应用程序因“ServiceConnectionLeaked”而崩溃
【发布时间】:2015-09-18 01:37:48
【问题描述】:

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

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。

【问题讨论】:

  • 这不是崩溃。再次检查您的日志。

标签: android crash


【解决方案1】:

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

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




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

【讨论】:

    猜你喜欢
    • 2023-03-14
    • 2019-12-26
    • 2012-05-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-07-16
    • 2017-10-16
    相关资源
    最近更新 更多