微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

firebase – 在AndroidX迁移后Firestore损坏

我刚刚迁移到 AndroidX并更新了我的Flutter依赖项.

我现在在使用Firestore时遇到错误.

例如:

//try {
 await ref.collection(‘collection’).document(document).updateData({
    'Field’: field,});
//} catch (e) {
//  debugPrint(e.toString());
//}

冻结应用程序并给出堆栈错误

StandardMethodCodec.decodeEnvelope (message_codecs.dart:564) MethodChannel.invokeMethod (platform_channel.dart:292)
_RootZone.runUnary (zone.dart:1379)
_FutureListener.handleValue (future_impl.dart:126)
_Future._propagatetoListeners.handleValueCallback (future_impl.dart:639)
_Future._propagatetoListeners (future_impl.dart:668)
_Future._completeWithValue (future_impl.dart:483)
_Future._asyncComplete.<anonymous closure> (future_impl.dart:513)
_microtaskLoop (schedule_microtask.dart:41)
_startMicrotaskLoop (schedule_microtask.dart:50)

message_codecs break on exception(564)是:

throw PlatformException(code: errorCode,message: errorMessage,details: errorDetails);

当catch错误错误是:

PlatformException(Error 0,null,null)

我用的是:

cloud_firestore: ^0.9.0+2
(firebase_auth: ^0.8.1+1)
(google_sign_in: ^4.0.1+1)
(firebase_messaging: ^3.0.1)

在Android上没有同样的问题.

感谢帮助!

更新:这与https://github.com/flutter/flutter/issues/28103不同.删除等待不修复冻结/问题.

解决方法

我遇到了同样的问题.
这是v0.9.0 2的错误.

它通过使用以前版本的cloud_firestore解决了它.

cloud_firestore:
    git:
      url: git://github.com/Flutter/plugins.git
      path: packages/cloud_firestore
      ref: 51696552700af8692fd7d595237fc9c4e273de93

Flutter似乎认为1和2是相同的版本.
即使指定了0.9.0 1,它也没有改变.
所以我做了以下几点.

>删除.pub-cache /,>指定以上版本>扑动包得到> cloud_firestore:0.9.0 1>扑动包得到

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐