When receiving data message from server, this error log is display:
E/AndroidRuntime: FATAL EXCEPTION: main Process: com.sample.test, PID: 30964 java.lang.RuntimeException: Unable to start service com.huawei.hms.rn.push.remote.HmsPushMessageService@d69f855 with Intent { act=com.huawei.push.action.MESSAGING_EVENT pkg=com.sample.test (has extras) }: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Context.getPackageName()' on a null object reference at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:4683) at android.app.ActivityThread.access$2900(ActivityThread.java:296) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2259) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:213) at android.app.ActivityThread.main(ActivityThread.java:8178) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Context.getPackageName()' on a null object reference at com.huawei.hms.rn.push.logger.HMSLogger.setupEventMap(HMSLogger.java:292) at com.huawei.hms.rn.push.logger.HMSLogger.(HMSLogger.java:78) at com.huawei.hms.rn.push.logger.HMSLogger.getInstance(HMSLogger.java:95) at com.huawei.hms.rn.push.remote.HmsPushMessageService.onMessageReceived(HmsPushMessageService.java:35) at com.huawei.hms.push.HmsMessageService.a(HmsMessageService.java:185) at com.huawei.hms.push.HmsMessageService.onStartCommand(HmsMessageService.java:131) at com.huawei.hms.rn.push.remote.HmsPushMessageService.onStartCommand(HmsPushMessageService.java:90) at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:4663) at android.app.ActivityThread.access$2900(ActivityThread.java:296) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2259) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:213) at android.app.ActivityThread.main(ActivityThread.java:8178) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101)
It seems your are using data messages, if yes tell me how you get data from notification? EX: In this code we are receiving "id" data message which we post from console or server:
}