flutter 的即时通讯 在测试环境正常,打包后不能发送消息

020-09-07 10:40:36.224 21250-21250/? W/adbd: timeout expired while flushing socket, closing
2020-09-07 10:40:36.359 31252-31252/? D/i: onMethodCall openClient, args:{r=false, clientId=Tom, signRegistry={sessionOpen=false, conversation=false}}
2020-09-07 10:40:36.359 31252-31252/? D/g: openClient...
2020-09-07 10:40:36.359 31252-31252/? D/k: add request cache. client=Tom, conv=null, request=-65533
2020-09-07 10:40:36.359 31252-31252/? E/e: session error:java.lang.IllegalStateException: Connection Lost
2020-09-07 10:40:36.359 31252-31252/? D/g: enter onOperationCompleted with clientId=Tom, convId=null, requestId=-65533, operation=CLIENT_OPEN
2020-09-07 10:40:36.359 31252-31252/? D/i: client open result: {clientId=Tom}
2020-09-07 10:40:36.360 31252-31321/? E/flutter: [ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception:
LC.RTM.Exception(
code: 0,
essage: java.lang.IllegalStateException: Connection Lost,
details: Connection Lost,
)
#0 Utilities.call (package:leancloudofficial_plugin/src/client.dart:122)

#1 Client.open (package:leancloud_official_plugin/src/client.dart:454)

#2 MyHomePageState.incrementCounter (package:im/main.dart:59)

2020-09-07 10:40:36.429 10394-10686/? I/SmartThreadExecutor: handleMessage: start check 0
2020-09-07 10:40:36.429 10394-10686/? I/SmartThreadExecutor: handleMessage: check end 0 -83 false
2020-09-07 10:40:36.530 1059-1059/? D/Zygote: Forked child process 783

你好,请问 Java SDK 使用哪个版本,测试机的网络环境是否正常呢?

openjdk version "1.8.0_242-release" ,测试机用debug包没问题,网络肯定没问题

      AVIMClient client = StringUtil.isEmpty(tag) ?
      AVIMClient.getInstance(clientId) : AVIMClient.getInstance(clientId, tag);
  client.open(openOption, new AVIMClientCallback() {
    @Override
    public void done(AVIMClient client, AVIMException e) {
      Log.d(TAG, "client open result: " + Common.wrapClient(client));
      if (null != e) {
        Log.d(TAG, "test1");
        result.success(Common.wrapException(e));
      } else {
        Log.d(TAG, "test2");
        result.success(Common.wrapSuccessResponse(Common.wrapClient(client)));
      }
    }
  });
  return;
}

我定位到test1这个地方了,再里面没跟踪

同样的问题,也是打包以后登录Client就Connection Lost,测试环境没有任何问题。有什么解决办法吗?

没有做,新初始化的项目

  buildTypes {
    release {
        // minifyEnabled false
        // TODO: Add your own signing config for the release build.
        // Signing with the debug keys for now, so `flutter run --release` works.
        //signingConfig signingConfigs.debug
        signingConfig signingConfigs.release
    }
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 28

lintOptions {
    disable 'InvalidPackage'
}

defaultConfig {
    // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
    applicationId "com.example.im"
    minSdkVersion 16
    targetSdkVersion 28
    versionCode flutterVersionCode.toInteger()
    versionName flutterVersionName
    multiDexEnabled true
}
 signingConfigs {
    release {
        keyAlias 'my-key-alias'
        keyPassword 'li198022'
        storeFile file("./my-release-key.keystore")
        storePassword 'li198022'
    }
}
buildTypes {
    release {
        // minifyEnabled false
        // TODO: Add your own signing config for the release build.
        // Signing with the debug keys for now, so `flutter run --release` works.
        //signingConfig signingConfigs.debug
        signingConfig signingConfigs.release
    }
}

}

flutter {
source '../..'
}

dependencies {
implementation('cn.leancloud:realtime-android:6.5.12') {
exclude group: 'cn.leancloud', module: 'realtime-core'
}
implementation('cn.leancloud:storage-android:6.5.12') {
exclude group: 'cn.leancloud', module: 'realtime-core'
}
implementation 'cn.leancloud:realtime-core:6.5.12'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'

testImplementation 'junit:junit:4.12'
implementation 'com.android.support:multidex:1.0.3'

}

这是整个build文件

这个bug没人管吗?

Java 的也是,本地测试能正常登录,正常发送消息,打包后发布测试环境,用户能正常登录但是发送消息时一直报连接丢失,java sdk 是1.8的