I am trying to retrieve my user details from the /User/ tree i have in Firebase. I have the following User object :
public class User { private String
You must be getting this error because your User class is a sub class.
Either mark your class static:
public class SomeParentClass{ public static class User { .... } }
or create it in a separate file.