终止应用程序<我的服务>(pid 1724),因为提供者<我的提供者>快要死了<我的应用程序> [英] Killing app <my service> (pid 1724) because provider <my provider> is in dying process <my app>

查看:58
本文介绍了终止应用程序<我的服务>(pid 1724),因为提供者<我的提供者>快要死了<我的应用程序>的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

提供程序在应用程序中实现,应用程序更新提供程序数据并触发远程服务,该服务查询提供程序以检索存储的值.一段时间后关闭应用程序,但服务继续访问内容提供程序.抛出logcat并导致远程服务崩溃.

A Provider is implemented in application and application updates provider data and triggers a remote service which queries the provider to retrieve the stored values.The application is closed after sometime but service keep on accessing the content provider.At some point the following error is thrown in logcat and the remote service is crashed.

由于提供者正在死亡,正在杀死应用程序(pid 1724)"

"Killing app (pid 1724) because provider is in dying process "

我搜索了此错误,但找不到有关此错误发生原因的信息.

I googled for this error and couldn't find information about why this error occurs.

更新:在其中一个地方,使用getApplicationContext返回的上下文而不是Service来获取contentresolver来查询内容提供者.有什么问题吗?

UPDATE: In one of the places context returned by getApplicationContext is used instead of Service to get contentresolver to query the content provider. Does it cause any problem?

推荐答案

嗯,祝您好运,到目前为止,还没有任何答案.我弄清楚是什么原因导致了上周的飞机坠毁!我想我应该在这里分享.

Hmm, hard luck, no answers so far. I figured out what has caused the crash last week! I guess i should share that here.

提供程序P在应用程序A中定义,该应用程序具有服务S1,该服务S1禁用程序包并出于某种原因终止程序包.现在有另一个应用程序B,它具有服务S2并使用提供程序P.服务S1在某个时候禁用了应用程序A包的某些组件并终止了该进程,这使提供程序可以找到与其连接的所有进程并终止它们一个,这使得应用程序B的运行过程因错误终止应用程序,因为提供者正在死亡而杀死应用程序"而终止.

Provider P is defined in application A which has a service S1 that disables the package and kills the package for some reason. Now there is another application B that has service S2 and uses the provider P. At some point service S1 disables some components of application A package and kills the process, that makes provider to find all the processes that are connected to it and kills those one by one, this makes the process in which application B is running to die with error "Killing app because provider is in dying process.

将提供程序移动到新的应用程序可以解决此问题,从而使其在自己的进程中运行可以解决该问题.

Moving the provider to a new application solved the issue so that it runs in its own process solved the issue.

这篇关于终止应用程序<我的服务>(pid 1724),因为提供者<我的提供者>快要死了<我的应用程序>的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆