【发布时间】:2020-10-11 15:18:09
【问题描述】:
我正在尝试更新文档并不断收到此错误:
ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: MissingPluginException(No implementation found for method DocumentReference#updateData on channel plugins.flutter.io/cloud_firestore
这就是我想要做的:
Firestore.instance.collection('myCollection').document(documentID).updateData({"fieldName": FieldValue.arrayUnion(newValue)});
我正在使用这个版本的 Firebase 和 Firestore
cloud_firestore: ^0.13.7
firebase_storage: ^3.1.6
我尝试按照此处的建议运行 flutter clean 和 flutter packages get:I/flutter (22027): MissingPluginException(No implementation found for method DocumentReference#setData on channel plugins.flutter.io/cloud_firestore)。我什至尝试按照同一篇文章中的建议将multiDexEnabled true 添加到我的build.gradle 文件中;都没有用。
我注意到我的 build.gradle 文件有这个颤振版本:
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
(不知道这是否与问题有关)
请帮忙!
谢谢。
【问题讨论】: