Flutter with firestore missing method

谁都会走 提交于 2021-02-08 10:27:21

问题


MissingPluginException(No implementation found for method DocumentReference#get on channel plugins.flutter.io/cloud_firestore)

Hello, i keep having this message for all the methods of firestore with flutter on an android device simulator. I followed the install instruction ("gms...google services" in first gradle and plugin on app gradle file, + the google services.json on app folder.

It seems that i should add the firestore api on the android dependencies but this is not on the officiel installation guide.

my pubspec.yaml :

environment:
  sdk: ">=2.0.0-dev.68.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  firebase_core: ^0.2.5
#  firebase_auth: ^0.5.20
  cloud_firestore: ^0.8.0
  rxdart: ^0.18.1

回答1:


Plugins depend on the native platform. You need to mock it to make code depending on it run without a device/emulator. See https://docs.flutter.io/flutter/services/MethodChannel/setMockMethodCallHandler.html, https://docs.flutter.io/flutter/services/BinaryMessages/setMockMessageHandler.html, https://docs.flutter.io/flutter/services/BasicMessageChannel-class.html



来源:https://stackoverflow.com/questions/52467457/flutter-with-firestore-missing-method

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!