I\'m trying to retrieve the updated User from the dataSnapshot of the Firebase Database:
mRef.addValueEventListener(new ValueEventListener() {
@Over
For Kotlin, if you're using data class like below for firebase,
data class UserModel(
var userName: String,
var userType: Int
)
then you'll get an error like
com.google.firebase.database.DatabaseException: UserModel does not define a no-argument constructor. If you are using ProGuard, make sure these constructors are not stripped.
So for this, you just need to initialize its values.
data class UserModel(
var userName: String = "",
var userType: Int = 0
)