Firebase服务冲突

时间:2018-11-12 11:10:25

标签: firebase flutter google-cloud-firestore firebase-storage

有时候,当我使用Firebase Firestore和Firebase存储依赖项构建项目时,应用程序崩溃了,这是零星的,我该如何解决?我需要使用某些特定版本吗?

我的pubspec.xml

dependencies:
  flutter:
    sdk: flutter
  path_provider:
  firebase_auth:
  cloud_firestore:  
  firebase_storage:  <------ The crashes begun when I add this firebase_storage dependencie
  sqflite:
  flutter_map: "^0.1.4"
  date_format: "^1.0.4"
  image_picker: 
  google_maps_flutter:
    git:
      url: git://github.com/flutter/plugins
      path: packages/google_maps_flutter

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^0.1.2

我认为我打电话时应用程序崩溃了

Firestore.instance.collection("users").document(uid).get().then((DocumentSnapshot documentSnapshot){
.....
.....
}

1 个答案:

答案 0 :(得分:0)

我用这个解决了我的问题

await Firestore.settings(timestampsInSnapshotsEnabled: true);

GitHub problem

GitHub example