你好,请问如何解决一下问题呢?有时能读到即时信息,有时不能,报错:
flutter2.0.0.pub-cache\hosted\pub.flutter-io.cn\leancloud_official_plugin-1.0.0-beta.12\lib\src\client.dart 在122行报错:
Exception has occurred.
RTMException (
LC.RTM.Exception(
code: 0,
essage: SESSION_REQUIRED,
details: null,
hashCode:59306310
))
我的flutter代码是:
print('===========Begin:===========');
print(User().clientID);
if (User().clientID != null) {
Client userClient = Client(id: User().clientID);
_selectedUserList.add('6022133eec14e4497af35cb6');
try {
conversation = await userClient.createConversation(
isUnique: true,
members: _selectedUserList,
name: User().clientID + '发起群聊');
print('===========conversation ===========');
print(conversation);
} catch (e) {
print('===========Error ===========');
print(e.message);
}
}
print('===========End ===========');
print(conversation);
Log详情:
V/AudioManager(15784): querySoundEffectsEnabled...
I/flutter (15784): ===========Begin:===========
I/flutter (15784): 88d5b080-6a91-11eb-a704-09e322ccbaff
D/LeancloudPlugin(15784): onMethodCall createConversation, args:{clientId=88d5b080-6a91-11eb-a704-09e322ccbaff, conv_type=0, name=88d5b080-6a91-11eb-a704-09e322ccbaff发起群聊, m=[6022133eec14e4497af35cb6, 88d5b080-6a91-11eb-a704-09e322ccbaff]}
D/LeancloudPlugin(15784): conv_type=0, m=88d5b080-6a91-11eb-a704-09e322ccbaff发起群聊, attr=null, ttl=0
D/PushService(15784): PushService#onCreate
D/AVConnectionManager(15784): start connection with callback...
D/AppRouter(15784): fetchRTMServerFromRemote. router=https://bniipgp0.lc-cn-e1-shared.com, appId=BNiIPgp0xCWH8Cg5ddYP77bS-9Nh9j0Va, installationId=f8a46b664de5f0aeb0fdd0e32c9fa0a0
I/PushService(15784): PushService#onStartCommand
D/PushService(15784): networking is fine and try to start connection to leancloud.
D/AVConnectionManager(15784): on starting connection, save callback...
D/PushService(15784): Connection resumed with Wifi...
D/AVConnectionManager(15784): on starting connection, save callback...
D/LoggingInterceptor(15784): Request: curl -X GET
D/LoggingInterceptor(15784): https://bniipgp0.lc-cn-e1-shared.com/v1/route?appId=BNiIPgp0xCWH8Cg5ddYP77bS-9Nh9j0Va&installationId=f8a46b664de5f0aeb0fdd0e32c9fa0a0&secure=1
D/LoggingInterceptor(15784): Response: 200
D/LoggingInterceptor(15784): server: openresty
D/LoggingInterceptor(15784): date: Sat, 13 Mar 2021 07:56:03 GMT
D/LoggingInterceptor(15784): content-type: application/json
D/LoggingInterceptor(15784): content-length: 183
D/LoggingInterceptor(15784): vary: Accept-Encoding
D/LoggingInterceptor(15784):
D/LoggingInterceptor(15784): {"groupId":"q0","groupUrl":"https:\/\/router-q0-push.leancloud.cn","server":"wss:\/\/cn-e1-cell2.leancloud.cn\/","ttl":3600,"secondary":"wss:\/\/cn-e1-core-k8s-cell-1.leancloud.cn\/"}
D/AVConnectionManager(15784): try to connect server: wss://cn-e1-core-k8s-cell-1.leancloud.cn/
D/AVStandardWebSocketClient(15784): onOpen socket=cn.leancloud.websocket.AVStandardWebSocketClient@c0736c6, status=101, statusMsg=Switching Protocols
D/AVConnectionManager(15784): webSocket(client=cn.leancloud.websocket.AVStandardWebSocketClient@c0736c6) established...
D/AVStandardWebSocketClient(15784): client(cn.leancloud.websocket.AVStandardWebSocketClient@c0736c6) uplink : cmd: login
D/AVStandardWebSocketClient(15784): appId: "BNiIPgp0xCWH8Cg5ddYP77bS-9Nh9j0Va"
D/AVStandardWebSocketClient(15784): installationId: "f8a46b664de5f0aeb0fdd0e32c9fa0a0"
D/AVStandardWebSocketClient(15784): loginMessage {
D/AVStandardWebSocketClient(15784): systemInfo {
D/AVStandardWebSocketClient(15784): deviceType: android
D/AVStandardWebSocketClient(15784): osVersion {
D/AVStandardWebSocketClient(15784): build: "HUAWEI/HONOR/OXF-AN10"
D/AVStandardWebSocketClient(15784): }
D/AVStandardWebSocketClient(15784): androidVersion {
D/AVStandardWebSocketClient(15784): codename: "REL"
D/AVStandardWebSocketClient(15784): apiLevel: "29"
D/AVStandardWebSocketClient(15784): }
D/AVStandardWebSocketClient(15784): isEmulator: false
D/AVStandardWebSocketClient(15784): }
D/AVStandardWebSocketClient(15784): }
D/AVDefaultConnectionListener(15784): web socket opened, send session open.
D/PushService(15784): processIMRequests...
D/PushService(15784): processIMRequestsFromClient...
D/DefaultSignatureFactory(15784): not found conversation signature factory for clientId: 88d5b080-6a91-11eb-a704-09e322ccbaff
D/AVStandardWebSocketClient(15784): client(cn.leancloud.websocket.AVStandardWebSocketClient@c0736c6) uplink : cmd: session
D/AVStandardWebSocketClient(15784): op: open
D/AVStandardWebSocketClient(15784): appId: "BNiIPgp0xCWH8Cg5ddYP77bS-9Nh9j0Va"
D/AVStandardWebSocketClient(15784): peerId: "88d5b080-6a91-11eb-a704-09e322ccbaff"
D/AVStandardWebSocketClient(15784): sessionMessage {
D/AVStandardWebSocketClient(15784): ua: "LeanCloud-Java-SDK/7.1.1"
D/AVStandardWebSocketClient(15784): r: true
D/AVStandardWebSocketClient(15784): deviceId: "f8a46b664de5f0aeb0fdd0e32c9fa0a0"
D/AVStandardWebSocketClient(15784): st: "xCWH8Cg5ddYP77bS-9Nh9j0Va-6a91-11eb-a704-09e322ccbaff30OqYTf5S7y3iXtPFigYyw"
D/AVStandardWebSocketClient(15784): lastPatchTime: 1615256686842
D/AVStandardWebSocketClient(15784): configBitmap: 175
D/AVStandardWebSocketClient(15784): }
W/oudsoft.franka(15784): Accessing hidden method Lsun/misc/Unsafe;->getInt(Ljava/lang/Object;J)I (greylist, linking, allowed)
W/oudsoft.franka(15784): Accessing hidden method Lsun/misc/Unsafe;->putInt(Ljava/lang/Object;JI)V (greylist, linking, allowed)
D/AVStandardWebSocketClient(15784): client(cn.leancloud.websocket.AVStandardWebSocketClient@c0736c6) uplink : cmd: conv
D/AVStandardWebSocketClient(15784): op: start
D/AVStandardWebSocketClient(15784): peerId: "88d5b080-6a91-11eb-a704-09e322ccbaff"
D/AVStandardWebSocketClient(15784): i: -65515
D/AVStandardWebSocketClient(15784): convMessage {
D/AVStandardWebSocketClient(15784): m: "6022133eec14e4497af35cb6"
D/AVStandardWebSocketClient(15784): m: "88d5b080-6a91-11eb-a704-09e322ccbaff"
D/AVStandardWebSocketClient(15784): unique: true
D/AVStandardWebSocketClient(15784): attr {
D/AVStandardWebSocketClient(15784): data: "{\"name\":\"88d5b080-6a91-11eb-a704-09e322ccbaff\345\217\221\350\265\267\347\276\244\350\201\212\"}"
D/AVStandardWebSocketClient(15784): }
D/AVStandardWebSocketClient(15784): }
D/AVConnectionManager(15784): client(cn.leancloud.websocket.AVStandardWebSocketClient@c0736c6) downlink: cmd: loggedin
D/AVConnectionManager(15784): appId: "BNiIPgp0xCWH8Cg5ddYP77bS-9Nh9j0Va"
D/AVConnectionManager(15784): installationId: "f8a46b664de5f0aeb0fdd0e32c9fa0a0"
D/AVConnectionManager(15784): service: 0
D/AVConnectionManager(15784): loggedinMessage {
D/AVConnectionManager(15784): pushDisabled: true
D/AVConnectionManager(15784): }
I/AVConnectionManager(15784): received close connection instruction from server.
D/AVConnectionManager(15784): client(cn.leancloud.websocket.AVStandardWebSocketClient@c0736c6) downlink: cmd: error
D/AVConnectionManager(15784): peerId: "88d5b080-6a91-11eb-a704-09e322ccbaff"
D/AVConnectionManager(15784): i: -65515
D/AVConnectionManager(15784): service: 2
D/AVConnectionManager(15784): errorMessage {
D/AVConnectionManager(15784): code: 4105
D/AVConnectionManager(15784): reason: "SESSION_REQUIRED"
D/AVConnectionManager(15784): }
D/AVDefaultConnectionListener(15784): new message arriving. peerId=88d5b080-6a91-11eb-a704-09e322ccbaff, requestId=-65515, command=7
D/LeancloudPlugin(15784): failed to create conv. cause:SESSION_REQUIRED
D/AVConnectionManager(15784): client(cn.leancloud.websocket.AVStandardWebSocketClient@c0736c6) downlink: cmd: session
D/AVConnectionManager(15784): op: opened
D/AVConnectionManager(15784): appId: "BNiIPgp0xCWH8Cg5ddYP77bS-9Nh9j0Va"
D/AVConnectionManager(15784): peerId: "88d5b080-6a91-11eb-a704-09e322ccbaff"
D/AVConnectionManager(15784): service: 2
D/AVConnectionManager(15784): serverTs: 1615622163923
D/AVConnectionManager(15784): sessionMessage {
D/AVConnectionManager(15784): st: "xCWH8Cg5ddYP77bS-9Nh9j0Va-6a91-11eb-a704-09e322ccbaff30OqYTf5S7y3iXtPFigYyw"
D/AVConnectionManager(15784): stTtl: 14725
D/AVConnectionManager(15784): }
D/AVDefaultConnectionListener(15784): new message arriving. peerId=88d5b080-6a91-11eb-a704-09e322ccbaff, requestId=null, command=0
D/AVDefaultConnectionListener(15784): processSessionCommand. op=opened,requestKey=null
D/AVDefaultSessionListener(15784): internal session open.
I/flutter (15784): ===========Error ===========
I/flutter (15784): SESSION_REQUIRED
I/flutter (15784): ===========End ===========
I/flutter (15784): null