Cactus
Cactus copied to clipboard
还是会有关于通知渠道的崩溃
android.app.RemoteServiceException: Bad notification for startForeground: java.lang.RuntimeException: invalid channel for service notification: Notification(channel=Cactus pri=-2 contentView=null vibrate=null sound=null defaults=0x0 flags=0x50 color=0x00000000 vis=PRIVATE) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2126) at android.os.Handler.dispatchMessage(Handler.java:112) at android.os.Looper.loop(Looper.java:216) at android.app.ActivityThread.main(ActivityThread.java:7625) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)
什么手机,android版本是多少?是偶现还是必现?你是点击如下按钮出现的奔溃吗?还是启动就报错了?
或者
说下为什么会出现这个问题的原因,因为android 8.0之后隐藏通知栏,使用的是deleteNotificationChannel方法隐藏,当app奔溃时候,cactus会进行拉活,但是发现不存在这个相应的渠道信息,所以就报错了。但是cactus会继续拉活,再一次拉活就不会出现这个问题了。除非你使用hideNotificationAfterO(false)方法不隐藏android 8.0之后的通知栏,或者保证你们的app永远不会奔溃(理论上不可能)。PS:我也在寻找其他方法解决此问题,目前还没有找到
感谢大佬的解答!
碰到同样问题,如果目前找不到方案解决可以先try_catch了,每个app都有崩溃率的kpi。所以还是要慎重
碰到同样问题,如果目前找不到方案解决可以先try_catch了,每个app都有崩溃率的kpi。所以还是要慎重
RemoteServiceException是系统级别的异常,try_catch无法捕获,如果不介意还是把android8.0之后的通知显示出来吧hideNotificationAfterO(false)
设置hideNotificationAfterO(true) 之后,出现的概率还是很大了,间隔一段时间 就会出现奔溃
设置hideNotificationAfterO(true) 之后,出现的概率还是很大了,间隔一段时间 就会出现奔溃
同样的问题,目前有好的解决方案不?