更新升级 专属应用 系统故障 硬件故障 电脑汽车 鸿蒙刷机 鸿蒙开发Linux教程 鸿蒙开发Linux命令
当前位置:HMXT之家 > 系统故障 > 关于鸿蒙系统收到消息后手机震动但通知栏无展示的一例说明

关于鸿蒙系统收到消息后手机震动但通知栏无展示的一例说明

更新时间:2021-12-01 16:18:27浏览次数:164+次

关于鸿蒙系统收到消息后手机震动但通知栏无展示的一例说明,如下。同时,附上Mate 9(EMUI 8)通知栏消息展示失败的说明。

1、错误日志

2541  2541 W StatusBarIconView: Drawable is too large (7125x7125) StatusBarIcon(icon=Icon(typ=RESOURCE pkg=com.huawei.hms.hmsdemo id=0x7f0a0015) visible user=0 )

1598  1598 I NotificationService: cancelNotificationLocked called,tell the app,reason = 4,sbn key = 0|com.huawei.hms.hmsdemo|35646797|null|10610

2、错误分析

资源过大,系统取消了通知的展示。2021年6月Google更新的安全补丁增加了对资源大小的限制。

\

相关参考:鸿蒙通知设置能够横屏展示消息及添加Hilink SDK到工程里

附:Mate 9(EMUI 8)通知栏消息展示失败

1]、错误日志

E/NotificationService( 1163): No Channel found for pkg=com.huawei.hms.hmsdemo, channelId=null, id=2001688309, tag=null, opPkg=com.huawei.android.pushagent, callingUid=10061, userId=0, incomingUserId=0, notificationUid=10637, notification=Notification(channel=null pri=0 contentView=null vibrate=null sound=default tick defaults=0x1 flags=0x10 color=0x00000000 vis=PRIVATE)

2]、错误分析

从Android O(EMUI 8)开始Google引入了通知渠道(Notification channels)的概念,如果App的targetSDKVersion>=26,不设置通知渠道就会导致通知无法展示。EMUI 8包含了Android O的通知渠道功能,NC未适配修改,导致消息无法展示,而EMUI 8.0之前没有通知渠道的概念,所以通知可正常展示。NC通过为应用创建一个“默认通知”渠道,保证即使应用不创建自己的通知渠道通知也可正常展示。可通过升级系统版本解决该问题。