本篇文章主要是用来做一个记录,项目中暂时没有按照文中的解决办法去解决。
最近线上有这样一个崩溃日志:
NO2:12 2.6.11.1003_199\F020EEB616CC7F21C3F1A5ACC5BB0E64
{STACK_TRACE=android.app.RemoteServiceException: can't deliver broadcast
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1689)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:163)
at android.app.ActivityThread.main(ActivityThread.java:6221)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
,pkg=xx.xx.xx,source=com.android.vending,
ActivityTrace=
0#NotifyCleanMiddleActivity.created;
1#NotifyCleanMiddleActivity.started;
2#NotifyCleanMiddleActivity.resumed;
3#NotifyCleanMiddleActivity.paused;
4#NotifyCleanFlowActivity.created;
5#NotifyCleanFlowActivity.started;
6#NotifyCleanFlowActivity.resumed;
7#NotifyCleanMiddleActivity.stopped;
8#NotifyCleanMiddleActivity.destroyed;
9#NotifyCleanFlowActivity.paused;
10#NotifyCleanFlowActivity.stopped;
11#NotifyCleanFlowActivity.destroyed;
12#NotifyCleanMiddleActivity.created;
13#NotifyCleanMiddleActivity.started;
14#NotifyCleanMiddleActivity.resumed;
15#NotifyCleanMiddleActivity.paused;
16#NotifyCleanFlowActivity.created;
17#NotifyCleanFlowActivity.started;
18#NotifyCleanFlowActivity.resumed;
19#NotifyCleanFlowActivity.paused;
20#NotifyCleanFlowActivity.stopped;,
client=17f9c3675f56df8d4cdd14ef5542d415,
data_dir=/data/user/0/xx.xx.xx,
time_zone=India Standard Time,
process=xx.xx.xx.monitor,
cgv=1.1.29.2-release,
lv=2.6.10.1001:198,
igc=0,android_id=9e33fc423e661e37,
AlwaysFinishActivity=false,vName=2.6.11.1003,vCode=199,system=false,sig=xxxxxxxxxxxxxxx,
cert=CN%3DApus+Launcher%2C+OU%3DApus+Apps%2C+O%3DApus+Group%2C+L%3DInterlaken%2C+ST%3DInterlaken%2C+C%3DCH%7C,
apk=2038457024afcc4d218c6c9173a08b0d,
ro.build.version.sdk=25,ro.product.model=Redmi 4,ro.product.manufacturer=Xiaomi,abi=armeabi-v7a,
web_version=64.0.3282.137;328213750,
gms_version=12.5.29 (040406-192802242);12529022,
occur_time=1525797672,timestamp_hera_install=1525792706,timestamp_hera_install_uptime=139088,
is_upgraded=0,recent_upgraded_time=1525537851,timestamp_hera_duration=4966,used_mem=124MB,
max_heap=192MB,inter_ava=2570MB,inter_tot=10086MB,exter_ava=2570MB,
exter_tot=10086MB,has_traces=0,has_dump=0,is_native=0,channel=google-play
}
搜了一下网上的解决办法,然后在stackoverflow上找到了一些思路:
这两篇文章归纳起来就是两点:
1、自己定义的broadcast的action常量要加上包名
2、使用LocalBroadcastManager