程序问答   发布时间:2022-06-02  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了Flutter FirebaseFirestore [cloud_firestore/failed-precondition] 问题大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

如何解决Flutter FirebaseFirestore [cloud_firestore/failed-precondition] 问题?

开发过程中遇到Flutter FirebaseFirestore [cloud_firestore/failed-precondition] 问题的问题如何解决?下面主要结合日常开发的经验,给出你关于Flutter FirebaseFirestore [cloud_firestore/failed-precondition] 问题的解决方法建议,希望对你解决Flutter FirebaseFirestore [cloud_firestore/failed-precondition] 问题有所启发或帮助;

我正在尝试执行在 @H_404_1@where 语句中包含 @H_404_1@orderBy 和 @H_404_1@FirebaseFirestore.instance.collection('collectionname').where('fIEldname1',isEqualTo: 'value1').orderBy('fIEldname1',descending:truE).snapshots() 的查询。我还为上述语句中定义的两个字段创建了一个复合索引。

不过,我收到此错误:

@H_404_1@[log] [cloud_firestore/Failed-precondition] Operation was rejected because the system is not in a state required for the operation's execution. If performing a query,ensure it has been indexed via the Firebase console.

我正在使用

@H_404_1@firebase_core: ^1.3.0
cloud_firestore: ^2.3.0

解决方法

我想索引可能有问题。我建议您按照以下步骤操作:

  1. 删除索引。
  2. 再次运行该函数。将抛出错误。
  3. 使用 adb logcat 检查日志。
  4. 将显示一些信息以创建适当的索引。

大佬总结

以上是大佬教程为你收集整理的Flutter FirebaseFirestore [cloud_firestore/failed-precondition] 问题全部内容,希望文章能够帮你解决Flutter FirebaseFirestore [cloud_firestore/failed-precondition] 问题所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。