Reputation: 21
I have class User which has additional info, but it is throwing:
com.google.firebase.database.DatabaseException: Serializing Collections is not supported, please use Lists instead
My code is:
User user = new User(Gender.valueOf(mGenderSpinner.getSelectedItem().toString()));
Log.d("GENDER", user.getGender().toString());
mFirebaseDatabase.getReference("Users")
.child(mAuth.getCurrentUser().getUid())
.setValue(user)
The question is how I can still set User.class value or this is not possible?
Upvotes: 1
Views: 558
Reputation: 8119
com.google.firebase.database.DatabaseException: Serializing Collections is not supported, please use Lists instead
Exception
show that you have unsupported Collections
object on User class just change with one of above supported type ex. List<Type>
.Update
Thanks to Alex Mamo comment,
Above is Data Types is for Firebase Cloud Database, But Firebase Realtime Database as following.
Pass types that correspond to the available JSON types as follows:
String
Long
Double
Boolean
Map<String, Object>
List
Upvotes: 1