登录后长连接马上就断了

android
标签: #<Tag:0x00007fb83ef386a0>

(jing) #1

debug没有这个问题,release 就回断掉,求原因


#2

检查这几个问题,网络限制等
切换网络试一下


(jing) #3

我刚安装上,连接上了,但是马上就断了网络没有问题


(jing) #4

用wifi也断,4g也断,但是debug版本什么问题都没有,需要我提供什么你帮我查下么


#5

这个问题是客户端连接的问题,我这边查不到什么。

你这个日志表示你的网络是有波动的,在重新连接成功-断开间重复。

你进程的状态是什么,是否调用stoppush,用4g网络的完整的日志提供一下


(jing) #6

新建文本文档 (3).txt (50.0 KB)
这个是4G网络下的初始化连接的日志,没有设置别名,进程前台运行状态


(jing) #7

新建文本文档 (3).txt (50.0 KB)


#8

在你的代码里面搜索一下stoppush
以及你的4g是否有用VPN


(jing) #9

没有用vpn,我debug版本就没有问题,我没有调用过stop,

我这里针对停止做了处理了


(jing) #10

我这里也没有使用内网,我直接在控制台发送的,但是debug版本没有问题,release版本就是不行,我使用的是4G网络,没有使用任何vpn


(jing) #11

同一台手机,release版本连接上几秒就断了,debug就没有任何问题


(jing) #12

求回复,非常着急,谢谢


#13

可能是混淆规则的问题,请你自己检查,根据集成文档,配置相关规则


(jing) #14

这个样子么,我这里这样配置的



(jing) #15

用官网生产demo的混淆也是不行


(jing) #16

新建文本文档.txt (9.0 KB)


(jing) #17

初始化到连接成功-断开的日志帮忙解决下

05-12 09:39:14.353 11469-11469/? W/JIGUANG-JPush: [AndroidUtil] AndroidManifest.xml missing activity: cn.jpush.android.ui.PopWinActivity
05-12 09:39:14.353 11469-11469/? W/JIGUANG-JPush: [AndroidUtil] You will unable to use pop-window rich push type.
05-12 09:39:14.455 11482-11482/? W/JIGUANG-JPush: [AndroidUtil] AndroidManifest.xml missing activity: cn.jpush.android.ui.PopWinActivity
05-12 09:39:14.456 11482-11482/? W/JIGUANG-JPush: [AndroidUtil] You will unable to use pop-window rich push type.
05-12 09:39:14.491 11504-11504/? W/JIGUANG-JPush: [AndroidUtil] AndroidManifest.xml missing activity: cn.jpush.android.ui.PopWinActivity
05-12 09:39:14.491 11504-11504/? W/JIGUANG-JPush: [AndroidUtil] You will unable to use pop-window rich push type.
05-12 09:39:14.611 11469-11469/? D/JIGUANG-JCore: [PushService] onStartCommand - intent:Intent { act=run.action cmp=com.gdkj.gddoctor.followup/cn.jpush.android.service.PushService (has extras) }, pkg:com.gdkj.gddoctor.followup, connection:0
05-12 09:39:14.612 11469-11501/? D/JIGUANG-JCore: [ARunAction]  pkg:com.gdkj.gddoctor.followup
05-12 09:39:14.612 11469-11501/? D/JIGUANG-JCore: [ARunAction] Bundle[{action=cn.jpush.android.intent.REPORT, report.extra.info=, report=crash_log, sdktype=JCORE}]
05-12 09:39:14.612 11469-11469/? D/JIGUANG-JCore: [PushService] onStartCommand - intent:Intent { act=cn.jpush.android.intent.INIT cmp=com.gdkj.gddoctor.followup/cn.jpush.android.service.PushService (has extras) }, pkg:com.gdkj.gddoctor.followup, connection:0
05-12 09:39:14.613 11469-11501/? D/JIGUANG-JCore: [JiguangTcpManager] Action - restartNetworkingClient, pid:11469
05-12 09:39:14.616 11469-11548/? I/JIGUANG-JCore: [NetworkingClient] Begin to run in ConnectingThread - id:737
05-12 09:39:14.669 11469-11548/? D/JIGUANG-JCore: [ConnectingHelper] To get sis - host:s.jpush.cn, port:19000, selection:0
05-12 09:39:14.675 11469-11548/? D/JIGUANG-JCore: [ConnectingHelper] SIS Receiving...
05-12 09:39:14.698 11469-11469/? D/JIGUANG-JCore: [PushService] onStartCommand - intent:Intent { act=run.action cmp=com.gdkj.gddoctor.followup/cn.jpush.android.service.PushService (has extras) }, pkg:com.gdkj.gddoctor.followup, connection:367137549680
05-12 09:39:14.698 11469-11469/? D/JIGUANG-JCore: [PushService] onStartCommand - intent:Intent { act=cn.jpush.android.intent.INIT cmp=com.gdkj.gddoctor.followup/cn.jpush.android.service.PushService (has extras) }, pkg:com.gdkj.gddoctor.followup, connection:367137549680
05-12 09:39:14.698 11469-11501/? D/JIGUANG-JCore: [ARunAction]  pkg:com.gdkj.gddoctor.followup
05-12 09:39:14.699 11469-11469/? D/JIGUANG-JCore: [PushService] onStartCommand - intent:Intent { act=run.action cmp=com.gdkj.gddoctor.followup/cn.jpush.android.service.PushService (has extras) }, pkg:com.gdkj.gddoctor.followup, connection:367137549680
05-12 09:39:14.699 11469-11501/? D/JIGUANG-JCore: [ARunAction] Bundle[{action=cn.jpush.android.intent.REPORT, report.extra.info=, report=crash_log, sdktype=JCORE}]
05-12 09:39:14.699 11469-11469/? D/JIGUANG-JCore: [PushService] onStartCommand - intent:Intent { act=run.action cmp=com.gdkj.gddoctor.followup/cn.jpush.android.service.PushService (has extras) }, pkg:com.gdkj.gddoctor.followup, connection:367137549680
05-12 09:39:14.699 11469-11501/? D/JIGUANG-JPush: [JPushDataAction] Action - onActionRun
05-12 09:39:14.702 11469-11501/? D/JIGUANG-JPush: [PushServiceCore] bundle:Bundle[{action=cn.jpush.android.intent.ALIAS_TAGS, seq_id=20837, tags=null, alias=alia2, sdktype=JPUSH}]
05-12 09:39:14.702 11469-11501/? D/JIGUANG-JPush: [PushServiceCore] Action - handleServiceAction - action:cn.jpush.android.intent.ALIAS_TAGS
05-12 09:39:14.708 11469-11501/? D/JIGUANG-JPush: [TagAliasHelper] action:setAliasAndTags - alias:alia2, tags:null
05-12 09:39:14.711 11469-11501/? D/JIGUANG-JPush: [JPushRequestHelper] Action - sendJPushRequest, timeout:20000, threadId:720
05-12 09:39:14.719 11469-11501/? D/JIGUANG-JPush: [JPushDataAction] Action - onActionRun
05-12 09:39:14.719 11469-11501/? D/JIGUANG-JPush: [PushServiceCore] bundle:Bundle[{action=cn.jpush.android.intent.ALIAS_TAGS, seq_id=20839, tags=null, alias=alia2, sdktype=JPUSH}]
05-12 09:39:14.719 11469-11501/? D/JIGUANG-JPush: [PushServiceCore] Action - handleServiceAction - action:cn.jpush.android.intent.ALIAS_TAGS
05-12 09:39:14.720 11469-11501/? D/JIGUANG-JPush: [TagAliasHelper] action:setAliasAndTags - alias:alia2, tags:null
05-12 09:39:14.720 11469-11501/? D/JIGUANG-JPush: [JPushRequestHelper] Action - sendJPushRequest, timeout:20000, threadId:720
05-12 09:39:14.741 11469-11548/? I/JIGUANG-JCore: [ConnectingHelper] Get sis info succeed with host: s.jpush.cn
05-12 09:39:14.745 11469-11548/? D/JIGUANG-JCore: [ConnectingHelper] Open connection with main - ip:121.46.20.43, port:7006
05-12 09:39:14.767 11469-11469/? D/JIGUANG-JCore: [PushReceiver] onReceive - android.net.conn.CONNECTIVITY_CHANGE
05-12 09:39:14.771 11469-11469/? D/JIGUANG-JPush: [PushReceiverCore] onReceive - android.net.conn.CONNECTIVITY_CHANGE
05-12 09:39:14.771 11469-11469/? D/JIGUANG-JCore: [PushService] onStartCommand - intent:Intent { act=run.action cmp=com.gdkj.gddoctor.followup/cn.jpush.android.service.PushService (has extras) }, pkg:com.gdkj.gddoctor.followup, connection:367137549680
05-12 09:39:14.772 11469-11469/? D/JIGUANG-JCore: [PushService] onStartCommand - intent:Intent { act=cn.jpush.android.intent.INIT cmp=com.gdkj.gddoctor.followup/cn.jpush.android.service.PushService (has extras) }, pkg:com.gdkj.gddoctor.followup, connection:367137549680
05-12 09:39:14.772 11469-11501/? D/JIGUANG-JCore: [ARunAction]  pkg:com.gdkj.gddoctor.followup
05-12 09:39:14.772 11469-11501/? D/JIGUANG-JCore: [ARunAction] Bundle[{action=cn.jpush.android.intent.REPORT, report.extra.info=, report=crash_log, sdktype=JCORE}]
05-12 09:39:14.772 11469-11469/? D/JIGUANG-JCore: [PushService] onStartCommand - intent:Intent { act=run.action cmp=com.gdkj.gddoctor.followup/cn.jpush.android.service.PushService (has extras) }, pkg:com.gdkj.gddoctor.followup, connection:367137549680
05-12 09:39:14.773 11469-11501/? D/JIGUANG-JPush: [JPushDataAction] Action - onActionRun
05-12 09:39:14.773 11469-11501/? D/JIGUANG-JPush: [PushServiceCore] bundle:Bundle[{action=cn.jpush.android.intent.ALIAS_TAGS, seq_id=20839, tags=null, alias=alia2, sdktype=JPUSH}]
05-12 09:39:14.774 11469-11501/? D/JIGUANG-JPush: [PushServiceCore] Action - handleServiceAction - action:cn.jpush.android.intent.ALIAS_TAGS
05-12 09:39:14.774 11469-11501/? D/JIGUANG-JPush: [TagAliasHelper] action:setAliasAndTags - alias:alia2, tags:null
05-12 09:39:14.774 11469-11501/? D/JIGUANG-JPush: [JPushRequestHelper] Action - sendJPushRequest, timeout:20000, threadId:720
05-12 09:39:14.780 11469-11469/? D/JIGUANG-JCore: [PushService] onStartCommand - intent:Intent { act=sendrequestdata.action cmp=com.gdkj.gddoctor.followup/cn.jpush.android.service.PushService (has extras) }, pkg:com.gdkj.gddoctor.followup, connection:367137549680
05-12 09:39:14.780 11469-11469/? D/JIGUANG-JCore: [PushService] onStartCommand - intent:Intent { act=sendrequestdata.action cmp=com.gdkj.gddoctor.followup/cn.jpush.android.service.PushService (has extras) }, pkg:com.gdkj.gddoctor.followup, connection:367137549680
05-12 09:39:14.781 11469-11469/? D/JIGUANG-JCore: [PushService] onStartCommand - intent:Intent { act=cn.jpush.android.intent.CONNECTIVITY_CHANGE cmp=com.gdkj.gddoctor.followup/cn.jpush.android.service.PushService (has extras) }, pkg:com.gdkj.gddoctor.followup, connection:367137549680
05-12 09:39:14.782 11469-11537/? D/JIGUANG-JCore: [RequestCacheManager] Action - sendRequestInternal - connection:367137549680, timeout:20000,sdkType:JPUSH, threadId:732
05-12 09:39:14.782 11469-11469/? D/JIGUANG-JCore: [PushService] onStartCommand - intent:Intent { act=sendrequestdata.action cmp=com.gdkj.gddoctor.followup/cn.jpush.android.service.PushService (has extras) }, pkg:com.gdkj.gddoctor.followup, connection:367137549680
05-12 09:39:14.783 11469-11537/? D/JIGUANG-JCore: [RequestCacheManager] Action - sendRequestInternal - connection:367137549680, timeout:20000,sdkType:JPUSH, threadId:732
05-12 09:39:14.785 11469-11537/? D/JIGUANG-JCore: [RequestCacheManager] Action - sendRequestInternal - connection:367137549680, timeout:20000,sdkType:JPUSH, threadId:732
05-12 09:39:14.837 11469-11548/? I/JIGUANG-JCore: [ConnectingHelper] Succeed to open connection - ip:121.46.20.43, port:7006
05-12 09:39:15.879 11469-11548/? D/JIGUANG-JCore: [JCommands] Action - receivedCommand - cmd:0
05-12 09:39:15.880 11469-11548/? I/JIGUANG-JCore: [ConnectingHelper] Register succeed - juid:9352274254, registrationId:170976fa8ab0a0fcd55, deviceId:null
05-12 09:39:15.882 11469-11548/? I/JIGUANG-JCore: [ConnectingHelper] Login with - juid:9352274254, appKey:5c93f02e81d67f3d3a4e1c82, sdkVersion:196609, analyticsVersion:0 ,shareVersion:0
05-12 09:39:15.949 11469-11548/? D/JIGUANG-JCore: [JCommands] Action - receivedCommand - cmd:1
05-12 09:39:15.950 11469-11548/? I/JIGUANG-JCore: [ConnectingHelper] Login succeed - sid:137274, serverTime;1494553154000
05-12 09:39:15.950 11469-11548/? D/JIGUANG-JCore: [ConnectingHelper] Action - sendServerTimer
05-12 09:39:15.991 11469-11537/? D/JIGUANG-JCore: [JiguangTcpManager] Action - onLoggedIn - connection:367137549680
05-12 09:39:15.991 11469-11548/? D/JIGUANG-JCore: [NetworkingClient] need not keep tcp connect,will close connection
05-12 09:39:15.991 11469-11548/? D/JIGUANG-JCore: [NetworkingClient] Action - closeConnection - connection:367137549680
05-12 09:39:15.991 11469-11537/? D/JIGUANG-JCore: [ConnectingHelper] Action - sendConnectionChanged
05-12 09:39:15.992 11469-11548/? D/JIGUANG-JCore: [NetworkingClient] Return of Close jni connection - 0
05-12 09:39:15.996 11469-11537/? I/JIGUANG-JCore: [ReportHelper] periodTasks...
05-12 09:39:16.514 11469-11579/? D/JIGUANG-JCore: [HttpHelper] status code:200
05-12 09:39:16.915 11469-11579/? D/JIGUANG-JCore: [HttpHelper] status code:200
05-12 09:39:17.788 11469-11537/? D/JIGUANG-JCore: [JiguangTcpManager] Already logged in. Give up to restart.
05-12 09:39:17.996 11469-11537/? D/JIGUANG-JCore: [RequestCacheManager] Action - sendRequestInternal - connection:0, timeout:0,sdkType:JCORE, threadId:732
05-12 09:39:27.802 11469-11537/? D/JIGUANG-JCore: [ConnectingHelper] Action - sendConnectionChanged
05-12 09:39:27.804 11469-11537/? D/JIGUANG-JCore: [NetworkingClient] Action - tryStop - connection:0

#18

-dontwarn cn.jpush.**
-keep class cn.jpush.** { *; }
这样就可以了。日志中看检测不到JPushInterface所以认为你不需要长连接,所以就断开了。所以很有可能是混淆的问题,因为你debug版本是没有混淆的。你可以参照我们的demo来写你的混淆规则,或者你release不要混淆看一下会不会有问题。


(jing) #19

-dontwarn cn.jpush.**
-keep class cn.jpush.** { *; }
也不行
不加混淆也不行
log和上面的一样


(jing) #20

求解,我不加混淆也不行