扑火失火的方法 [英] Flutter with firestore missing method

查看:46
本文介绍了扑火失火的方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

您好,我在Android设备模拟器上始终收到关于带扑扑的Firestore的所有方法的消息.我按照安装说明进行操作(第一个gradle中的"gms ... google services"和应用gradle文件中的插件,以及app文件夹中的google services.json.

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.

似乎我应该在android依赖项上添加firestore api,但这不在officiel安装指南中.

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

我的pubspec.yaml:

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

推荐答案

插件取决于本机平台.您需要对其进行模拟,以使代码在没有设备/仿真器的情况下运行.请参阅 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

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

这篇关于扑火失火的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆