I tried to look at similar questions but they are of no use for me.
I have a class:
data class TextMessage(val text: String,
override
The generated class file for TextMessage has the following methods defined. This was obtained by running javap against it:
public final java.lang.String getText();
public java.util.Date getTime();
public java.lang.String getSenderId();
public boolean isText();
The Firestore SDK is confused because it derives the names of document properties from the names of the getters in the class. So, by JavaBean convention, getText() becomes "text". And isText() also becomes "text". Firestore doesn't know which one you wanted to use for the document property called "text", hence the message.
You will have to change the name of one or the other to avoid this conflict. Alternately, you can try to use the PropertyName annotation to alter Firestore's naming of the field for either one.