How to initialize default values for GeoPoint in a data class
问题 I'm trying to convert documents to objects from Firestore, but when I create my data class , I dont know how to initialize the GeoPoint with default values as it needs to be declared for an empty constructor data class MapObj(val geopoint:Geopoint) //--> how to initialize it to get an empty constructor The problem relies on this line val obj = snapshot.toObject(MapObj::class.java) Thanks 回答1: The problem is that the Firestore SDK isn't finding a default, no argument constructor for MapObj.