'Firestore asks me create the index that is already exist

I'm trying to paginate comments. The first 10 comments is loading ok, but next ones (when query contains startAfterDocument) return error like:

Query(comments where movie_id == 1041047 order by -created, __name__) failed: Status{code=FAILED_PRECONDITION, description=The query requires an index. You can create it here: https://console.firebase.google.com/project/.......

But this index is already exist, I created it before. And if I follow the suggestion link Firebase Console tells me the same: this index is exist.

  Future<List<DocumentSnapshot>> _loadPageFrom(
      int index, DocumentSnapshot lastDoc) async {
    Query query = Firestore.instance
        .collection('comments')
        .where('movie_id', isEqualTo: movieID)
        .orderBy('created', descending: true);

    if (lastDoc != null) query = query.startAfterDocument(lastDoc);
    final snapshot = await query.limit(10).getDocuments();

    return snapshot.documents;
  }

What problem is here?



Solution 1:[1]

If you had recently deleted your index, you will need to wait a little bit until it's deleted from your project inside GCP, after that you will be able to create it again.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1