你好,我这边在使用LeanCloud Flutter SDK做APP。今天开始运行时出现 type '_ContentType' is not a subtype of type 'String' 的 Dio Error。我搜了一下没有找到解决方案,之前确认能工作的 project 不做修改的情况下,也在 pub update之后出现了同样的错误。我的代码是挺基础的添加测试,如下:

LeanCloud.initialize(
  'StC8G910RCTHJM981WC9gxYS-9Nh9j0Va',
  '略',
  server: 'https://stc8g910.lc-cn-e1-shared.com',
  queryCache: new LCQueryCache()
);
print('connected');
print('adding testObj');
LCObject testObj = LCObject('Test');
testObj['data'] = 'test string';
await testObj.save();
print('added test object.');

出现的错误信息 :

Flutter版本:
Flutter 1.17.5 • channel stable • https://github.com/flutter/flutter.git1
Framework • revision 8af6b2f038 (6 weeks ago) • 2020-06-30 12:53:55 -0700
Engine • revision ee76268252
Tools • Dart 2.8.4

LeanCloud Storage SDK 版本 0.4.2

实在不知道是哪里出问题了,感谢帮助 🙏

我不太清楚应该怎么打印请求日志,请问能否在你那边试下 LeanCloud 现在能不能用 Flutter 储存 LCObject.

1 人赞了这个帖子.

请把请求的日志打印出来看一下。
应该是 dio 更新了 breaking changes 的版本。
目前 SDK 用的 dio 是 3.0.8