Flutter 无法获取令牌

Flutter 无法获取令牌,flutter,dart,google-cloud-firestore,Flutter,Dart,Google Cloud Firestore,尝试将一些数据提取到云firestore数据库中,当我执行此操作时,出现以下错误未能获取令牌:com.google.firebase.firestore.FirebaseFirestoreException:getToken由于令牌更改而中止。 公开发行 cloud_firestore: ^0.9.7 firebase_auth: ^0.8.1+4 android/build.gradle: dependencies { classpath 'com.android.tools.buil

尝试将一些数据提取到云firestore数据库中,当我执行此操作时,出现以下错误
未能获取令牌:com.google.firebase.firestore.FirebaseFirestoreException:getToken由于令牌更改而中止。

公开发行

cloud_firestore: ^0.9.7
firebase_auth: ^0.8.1+4
android/build.gradle:

 dependencies {
  classpath 'com.android.tools.build:gradle:3.2.1'       
  classpath 'com.google.gms:google-services:3.1.0'
 }
获取员工信息的方法:

static addEmployee(Map<String, dynamic> snapshot){
  Firestore.instance.runTransaction((Transaction tx) async{
   await tx.set(Firestore.instance.collection('employee').document(),snapshot);
    });
  }
static addEmployee(映射快照){
Firestore.instance.runTransaction((事务发送)异步{
等待tx.set(Firestore.instance.collection('employee').document(),快照);
});
}

如果你遇到这个问题,请告诉我,谢谢

对于错误[FirestoreCallCredentials]:获取令牌失败:

  • 转到-选择您的项目
  • 选择API和服务
  • 选择凭据
  • 并更新API键中的值