Firebase Database Class kotlin.Pair does not define a no-argument constructor

Viewed 25

I created a simple data class in Kotlin to read value from Firebase database, but I get the exception. Here is my model class:

data class UserInfo(val userSelectionList: List<Pair<Int,Int>>? = null) {}

Here is the line I get DatabaseException

UserInfo userInfo =snapshot.getValue(UserInfo.class);

I know data class creates automatically no-argument constructor, but I don't understand why I get this error.

com.google.firebase.database.DatabaseException: Class kotlin.Pair does not define a no-argument constructor. If you are using ProGuard, make sure these constructors are not stripped.

0 Answers
Related