Rongcloud_im_plugin 升级后获取 objectName 报错问题

开发者在使用 rongcloud_im_plugin 升级到 5.3.0 之后版本,会遇到

fetchAllMessageMapper 方法调用报错问题,

修改方案如下:

  1. 本地依赖 SDK

    参考 Using packages | Flutter

  2. 修改 android/src/main/java/io/rong/flutter/imlib/RCIMFlutterWrapper.java 文件内的 fetchAllMessageMapper 方法

代码如下:

```

private void fetchAllMessageMapper() {

RongCoreClient client = RongCoreClient.getInstance();

Field field = null;

try {

field = client.getClass().getDeclaredField(“mRegCache”);

field.setAccessible(true);

List mRegCache = new ArrayList<>((Collection) field.get(client));

for (String className : mRegCache) {

registerMessageType(className);

}

} catch (NoSuchFieldException e) {

e.printStackTrace();

} catch (IllegalAccessException e) {

e.printStackTrace();

}

}

```

重新编译运行即可。