I\'ve looked at a few other answers for similar problems but don\'t understand why mine isn\'t working.
I\'m trying to get my app to read commands from Firebase and
I faced a similar issue where I could not retrieve the data from the database; having a DatabaseException error with a message
can't convert from this type to that type.
The mistake I was making was I was writing incorrectly to the database. I wrote something like ...
mdatabaseReference.setValue(myObject)
instead of
mdatabaseReference.child(myObject.getId()).setValue(myObject)
So essentially the answer I am suggesting is: you should ensure your data is written correctly to the database at the right node in the JSON tree if not you would likely get this kind of error when you are reading from the database.