Cannot find the method whereArrayContains() for Firestore Android

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



Cannot find the method whereArrayContains() for Firestore Android



Previously I asked a question about data model where I got a useful link for how to work with arrays here.



But as told by Frank van Puffelen (@FrankvanPuffelen), within the comments, there, that it will change, it changed and there is a new documentation.



But now I cannot find the method whereArrayContains(), e.g.:


whereArrayContains()


CollectionReference messageRef = mFirestoreDb.collection("messages");
Query query = messageRef.whereArrayContains("...", "..."); //?



As for dependencies, it's up to date with Set up your development environment till now as I am writing this question.


implementation 'com.google.firebase:firebase-firestore:17.0.4'



Am I doing something wrong here?





It seems the documentation is ahead of the actual release.
– Doug Stevenson
Aug 12 at 2:55





Maybe, but generally after update the documentation is written, isn't it?
– Rajarshi
Aug 12 at 4:29





Generally, but I checked this out with the Firestore team today. Updates are coming coming.
– Doug Stevenson
Aug 12 at 4:30





@DougStevenson Ok, let it "come come" :p. However, can I ask you another question, a favor maybe? Being new to this, I mean all of these, what I understand that Firestore uses OKHttp. By any chance you guys can give us some public methods so that we can at least catch the network errors? This way we can keep track of network (without any broadcast receiver) and maybe implement a retry button on the failed network call!
– Rajarshi
Aug 12 at 4:45





If you have a new question that's unrelated to the first, please ask separately as such.
– Doug Stevenson
Aug 12 at 4:53





1 Answer
1



In order to solve this issue, you need to upgrade Firestore dependency to the latest version. So please change the following line of code:


implementation 'com.google.firebase:firebase-firestore:17.0.4'



to


implementation 'com.google.firebase:firebase-firestore:17.0.5'



And the new method that you are looking for will be available. Please see here more details.





Finally the new version is here, thanks for the heads up.
– Rajarshi
Aug 14 at 13:30





@Rajarshi Ya, it's here. You're welcome, cheers!
– Alex Mamo
Aug 14 at 13:31






It's 17.1.0 tho
– Florian Walther
Aug 17 at 8:16





@FlorianWalther At the time I have answered this question, the version available for Cloud Firestore was 17.0.5. All dependencies are constantly changing, that's why I have added that link in my answer so future visitors can use the latest version.
– Alex Mamo
Aug 17 at 8:43


17.0.5





@AlexMamo it doesn't matter as it will change as long as the product lives; at the time I wrote the question, the method was not there but was in the document. Interesting read: "To avoid potential errors, don't use v17.0.5."
– Rajarshi
Aug 18 at 5:17







By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

Creating a leaderboard in HTML/JS