android 无法接收到消息

android
jmessage
收不到消息
标签: #<Tag:0x00007fb83ce42810> #<Tag:0x00007fb83ce42608> #<Tag:0x00007fb83ce42428>

(微笑) #1
12-26 16:03:52.265 1610-1610/com.jh.wz D/ActivityThread: BDC-Calling onReceive: intent=Intent { act=cn.jpush.im.android.action.IM_RESPONSE cat=[com.jh.wz] flg=0x10 cmp=com.jh.wz/cn.jpush.im.android.helpers.IMReceiver (has extras) }, receiver=cn.jpush.im.android.helpers.IMReceiver@2bdace3
12-26 16:03:52.267 1610-1610/com.jh.wz I/JIGUANG-JMessage: [ResponseProcessor]  messageID = 515701570
12-26 16:03:52.269 1610-1610/com.jh.wz D/ActivityThread: BDC-RECEIVER handled : 0 / ReceiverData{intent=Intent { act=cn.jpush.im.android.action.IM_RESPONSE cat=[com.jh.wz] flg=0x10 cmp=com.jh.wz/cn.jpush.im.android.helpers.IMReceiver (has extras) } packageName=com.jh.wz resultCode=-1 resultData=null resultExtras=null}
12-26 16:03:52.327 1610-1621/com.jh.wz I/System: FinalizerDaemon: finalize objects = 354
12-26 16:03:52.443 1610-1624/com.jh.wz I/art: Background partial concurrent mark sweep GC freed 2731(160KB) AllocSpace objects, 1(1028KB) LOS objects, 18% free, 17MB/21MB, paused 752us total 114.473ms

(微笑) #2
**12-26 16:10:55.834 3983-4074/com.jh.wz E/JMessagePlugin: java.lang.reflect.InvocationTargetException**
12-26 16:10:56.230 3983-3983/com.jh.wz I/JIGUANG-JMessage: [JMessageClient] JMessage SDK init finished! version = 2.3.0 build id = 901
12-26 16:10:56.291 3983-3983/com.jh.wz W/JIGUANG-JMessage: [IMReceiver] format extra data .map = {push_network_connected=true}
12-26 16:10:56.687 3983-3983/com.jh.wz I/JIGUANG-JMessage: [RequestProcessor] start SyncCheck

日志里面有一个这个错


#3

给完整的客户端日志,这里提示 JMessage 注册失败了


(微笑) #4
12-26 16:10:55.834 3983-4074/com.jh.wz E/JMessagePlugin: java.lang.reflect.InvocationTargetException
12-26 16:10:56.230 3983-3983/com.jh.wz I/JIGUANG-JMessage: [JMessageClient] JMessage SDK init finished! version = 2.3.0 build id = 901
12-26 16:10:56.291 3983-3983/com.jh.wz W/JIGUANG-JMessage: [IMReceiver] format extra data .map = {push_network_connected=true}
12-26 16:10:56.687 3983-3983/com.jh.wz I/JIGUANG-JMessage: [RequestProcessor] start SyncCheck
12-26 16:10:56.689 3983-3983/com.jh.wz D/JIGUANG-JMessage: [RequestingThread] Action - onLoggedIn
12-26 16:10:56.690 3983-3983/com.jh.wz D/JIGUANG-JMessage: [RequestingThread] Action - sendRequestInternal - connection:, timeout:60000, threadId:1
12-26 16:10:56.691 3983-3983/com.jh.wz D/JIGUANG-JMessage: [RequestingThread] Action - sendCommandWithLoggedIn
12-26 16:10:56.691 3983-3983/com.jh.wz D/JIGUANG-JMessage: [RequestingThread] request is [Requesting] - timeout:50000, times:1, request:[Request] - [JHead] - len:0, version:1, command:100, rid:18030, sid:41544, juid:6263064481
12-26 16:10:56.691 3983-3983/com.jh.wz D/JIGUANG-JMessage: [RequestingThread] Request params - cmd:100
12-26 16:10:58.699 3983-3983/com.jh.wz D/JIGUANG-JMessage: [RequestingThread] Action - sendRequestInternal - connection:, timeout:60000, threadId:1
12-26 16:10:58.700 3983-3983/com.jh.wz D/JIGUANG-JMessage: [RequestingThread] Action - sendCommandWithLoggedIn
12-26 16:10:58.700 3983-3983/com.jh.wz D/JIGUANG-JMessage: [RequestingThread] request is [Requesting] - timeout:50000, times:1, request:[Request] - [JHead] - len:0, version:1, command:100, rid:18032, sid:41544, juid:6263064481
12-26 16:10:58.700 3983-3983/com.jh.wz D/JIGUANG-JMessage: [RequestingThread] Request params - cmd:100

(lavenderln) #5

你网络稳定吗,从最后一个日志看超时了,从第一个日志看是收到了消息的


(微笑) #6

网络是wifi状态下,我通过管理后台发送一条消息,app直接就能够被通知到 ,但是onEvent 就是不执行


(微笑) #7
12-26 16:45:29.607 8297-8297/com.jh.wz D/ActivityThread: BDC-Calling onReceive: intent=Intent { act=cn.jpush.im.android.action.IM_RESPONSE cat=[com.jh.wz] flg=0x10 cmp=com.jh.wz/cn.jpush.im.android.helpers.IMReceiver (has extras) }, receiver=cn.jpush.im.android.helpers.IMReceiver@f8c40cf
12-26 16:45:29.608 8297-8297/com.jh.wz I/JIGUANG-JMessage: [ResponseProcessor]  messageID = 515730174
12-26 16:45:29.608 8297-8297/com.jh.wz D/ActivityThread: BDC-RECEIVER handled : 0 / ReceiverData{intent=Intent { act=cn.jpush.im.android.action.IM_RESPONSE cat=[com.jh.wz] flg=0x10 cmp=com.jh.wz/cn.jpush.im.android.helpers.IMReceiver (has extras) } packageName=com.jh.wz resultCode=-1 resultData=null resultExtras=null}
12-26 16:45:29.651 8297-8306/com.jh.wz I/System: FinalizerDaemon: finalize objects = 180
12-26 16:45:29.766 8297-8372/com.jh.wz D/AudioManager: AudioManager dispatching onAudioFocusChange(-3) for android.media.AudioManager@684e183com.rjfun.cordova.plugin.nativeaudio.NativeAudio@19c1f00
12-26 16:45:30.799 8297-8372/com.jh.wz D/AudioManager: AudioManager dispatching onAudioFocusChange(1) for android.media.AudioManager@684e183com.rjfun.cordova.plugin.nativeaudio.NativeAudio@19c1f00

这是每次收到消息之后的输出内容


(lavenderln) #8

这个日志显示消息收到了,messageID是消息ID,你看看事件处理这块的文档
https://docs.jiguang.cn/jmessage/client/im_sdk_android/#_57


(微笑) #9

使用的是cordova插件,直接用android stdio调试的时候,发现JMessagePlugin.java 的 onEvent 方法一直都没有执行 。


(lavenderln) #10

插件的话我就不清楚了 ,你看看事件有没有注册
走onEvent方法有几个条件:事件接收类一定要注册;要有消息或事件收到才会进入该事件
看日志消息是收到了,没有走onEvent方法的话就看看是否有注册


(Hevin) #11

调用初始化 - init 方法了吗?


(微笑) #12

是调用了的 ~


(微笑) #13

找到问题了 init 必须传参数 ,cordova插件有问题 希望做完善一点~~~~ 问题就是在于 java.lang.reflect.InvocationTargetException 这个异常。


#14

感谢分享你的解决方案

极光现在正在开展征文活动,写写文章就能赢 Filco 和 VIP 服务,100% 获得 20 元京东电子充值卡,技术、产品、运营、数据分析、读后感均可, 详情:

有空可以来写写使用感想[表情]