Firebase Serialization Issues [UPDATED]
This is happening because you have added in your User
class the balance
object which is of type BigDecimal
. As in the official documentation regarding Firebase realtime databse data tyes, the BigDecimal
is not a supported data type. To solve this, you should change te type of your balance
object to a supported data type. I recommend you to change it to a Double
.
Firebase No properties to serialize found on class
Firebase require your Pojo to have public variables or getter/setter.
Change variable declarations to public
public String nombre;
public String apellidos;
public String telefono;
public String email;
public Boolean tieneWhatsapp;
public Boolean tieneTelegram;
public Boolean tieneHangouts;
public Long formaPago;
public Double ratioHora;
public Double precioHora;
public Double horasCompensadas;
How do I fix this Firebase RunTime DB error where the entry into the database and authentication details are created but all the fields are null?
From the comments it sounds like createUserWithEmailAndPassword
fails. When that happens, the task actually contains an exception with more information about the failure - but you're not handling that.
A better way to handle task failure is:
public void onComplete(@NonNull Task<Void> task) {
if(task.isSuccessful()){
...
}
else{
Toast.makeText(Register.this,"Failed to Register User", Toast.LENGTH_LONG).show();
Log.e("Create user", "Failed to create user", task.getException());
}
progressBar.setVisibility(ViewStub.GONE);
}
With this, the cause of the task failure will show up in your logcat output.
com.google.firebase.database.DatabaseException: No properties to serialize found on class android.view.animation.AccelerateDecelerateInterpolator
Most Android classes, such as android.view.animation.AccelerateDecelerateInterpolator
, cannot be written to the database without you writing custom code for that.
Your code will need to extract the important values from the AccelerateDecelerateInterpolator
and write to to Firebase. Then when you read from the database, you'll have to create a AccelerateDecelerateInterpolator
out of those properties again.
Also see:
- Firebase Android - Crash with "Found a conflicting setters with name: setGregorianChange" when .setValue() (where I gave a longer explanation)
com.google.firebase.database.DatabaseException: Serializing Arrays is not supported, please use Lists instead
I've managed to find the reason causing this crash. I installed the app on another device running Android 5.x and Firebase threw a much less confusing exception there:
com.google.firebase.database.DatabaseException: No properties to serialize found on class android.graphics.Paint$Align
It appeared that Firebase (unlike Gson) tries to serialize all possible getters even though they don't have direct connection with global variables (class members / fields), in my particular case one of my objects contained a method returning Drawable
- getDrawable()
. Obviously, Firebase doesn't know how to convert drawable into json.
Interesting moment (probably a bug in Firebase SDK): on my older device running Android 4.4.1 I still get my original exception in the same project and configuration:
Caused by: com.google.firebase.database.DatabaseException: Serializing Arrays is not supported, please use Lists instead
Related Topics
How to Animate a Path on an Android Canvas
Getting a Photo from a Contact
Android Detect Done Key Press for Onscreen Keyboard
Hide Ics Back Home Task Switcher Buttons
Android - Supportmapfragment with Googlemaps API 2.0 Giving Illegalargumentexception
Android Resources$Notfoundexception: Resource Id #0X7F030027
How to Handle Multiple Countdown Timers in Listview
Cmusphinx Pocketsphinx - Recognize All (Or Large Amount) of Words
Copy Database from Assets to Databases Folder
ASP.NET Web API Authentication
Disable Logcat Output Completely in Release Android App
How to Pass Multiple Primitive Parameters to Asynctask
Android - Startactivityforresult Immediately Triggering Onactivityresult
How to Use a Tablayout with Toolbar Inside Collapsingtoolbarlayout
Android Room Persistent Library - How to Insert Class That Has a List Object Field
Hw Accelerated Activity - How to Get Opengl Texture Size Limit