Here's how this was resolved for me.
The issue occurred when I was trying to update an int field in database. I was getting text from edit text field and forgot to convert that into an int. This caused the failure. So try checking the data type you're sending to the database if this issue occurs.