Skip to content
Advertisement

Cannot resolve method ‘setTimestampsInSnapshotsEnabled’ in ‘Builder’

I am trying to create a register activity to allow a user to register however I keep getting the error:

Cannot resolve method ‘setTimestampsInSnapshotsEnabled’ in ‘Builder'”

It’s only the section which has the setTimestampsInSnapshotsEnabled that is giving me the issue. Do I need an implementation?

Here is my Java code:

JavaScript

Advertisement

Answer

If I look at the current documentation for FirebaseFirestoreSettings.Builder, I don’t see any setTimestampsInSnapshotsEnabled method. So that probably explains the error message: you’re trying to call a method that doesn’t exist.

My guess is that your code was meant for an older version of the SDK when the method did exist. Since it doesn’t exist anymore now, you either have to use the version of the SDK that the code was made for, or remove the call.

Update: it looks like timestampsInSnapshotsEnabled was removed in version 22 of the Android SDK for Firestore back in October 2020.

Advertisement