sdk:cn.leancloud:realtime-android:6.5.0,6.4.+版本同样有这个问题。
android环境:Xiaomi
代码如下:
this.client = AVIMClient.getInstance(userId); this.client.open(new AVIMClientCallback() { @Override public void done(AVIMClient client, AVIMException e) { if (e == null) { // 成功打开连接 System.out.println("聊天功能建立成功!"); }else { System.out.println("聊天功能建立失败!"+e); } } });
发现开发环境下能够建立聊天,但build release apk后无法连接,如下错误:
2020-04-15 11:26:58.671 16727-16819/? D/j: Request: curl -X GET
https://leancloud.xxxxxx.com/v1/route?appId=xxxxxxxx-gzGzoHsz&installationId=3bd5e6df6b103289b0bf64cddfc81547&secure=1
2020-04-15 11:26:58.672 16727-16819/? D/j: Response: 200
server: openresty
date: Wed, 15 Apr 2020 03:26:59 GMT
content-type: application/json
content-length: 179
vary: Accept-Encoding
strict-transport-security: max-age=31536000
{"groupId":"g0","groupUrl":"https:\/\/router-g0-push.leancloud.cn","server":"wss:\/\/rtm56.leancloud.cn\/","ttl":14400,"secondary":"wss:\/\/cn-n1-core-k8s-cell-13.leancloud.cn\/"}
2020-04-15 11:26:58.682 16727-16727/? D/f: try to connect server: null
2020-04-15 11:26:58.683 16727-16727/? E/f: failed to parse targetServer:null, cause:Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference