Firebase "User is missing a constructor with no arguments"
<p>I am trying to retrieve my user details from the /User/ tree i have in Firebase.  I have the following User object : </p>

<pre><code>public class User {
    private String name;
    private String email;
    private FirebaseUser firebaseUser;
    private String lastOnline;
    private LatLng latLng;
    private ArrayList&lt;SwapLocation&gt; locations;

    public User(){ }

    public String getName(){
        if(firebaseUser.getDisplayName() != null &amp;&amp; !firebaseUser.getDisplayName().equals(""))
            return firebaseUser.getDisplayName();

        if(name != null &amp;&amp; !name.equals(""))
            return name;

        return "";
    }
    public void setName(String name){
        this.name = name;
    }

    public String getEmail(){
        if(firebaseUser.getEmail() != null &amp;&amp; firebaseUser.getEmail().equals(""))
            return firebaseUser.getEmail();

        if(email != null &amp;&amp; email.equals(""))
            return email;

        return "";
    }
    public void setEmail(String email){
        this.email = email;
    }

    public void setFirebaseUser(FirebaseUser firebaseUser){
        this.firebaseUser = firebaseUser;  
    }
    public FirebaseUser getFirebaseUser(){
        return firebaseUser;
    }

    public void setLastOnline(String lastOnline){
        this.lastOnline = lastOnline;
    }
    public String getLastOnline(){
        if(lastOnline != null)
            return lastOnline;

        return "";
    }

    public void setLatLong(LatLng latlng){
        this.latLng = latlng;
    }
    public LatLng getLatLong(){
        return this.latLng;
    }

    public ArrayList&lt;SwapLocation&gt; getLocations(){
        return locations;
    }
    public void setLocations(ArrayList&lt;SwapLocation&gt; locations){
        this.locations = locations;
    } 
}
</code></pre>

<p>I am trying to retrieve this object from Firebase.  The object is retrieved in the dataSnapshot, although it has a problem serializing to my User object.</p>

<p>This is how i am retrieving the object from Firebase:</p>

<pre><code>DatabaseReference ref = FirebaseDatabase.getInstance().getReference().child(users_group).child(user.getUid());
        ref.addListenerForSingleValueEvent(
            new ValueEventListener() {
                @Override
                public void onDataChange(DataSnapshot dataSnapshot) {
                    User this_user = dataSnapshot.getValue(User.class); 
                }

                @Override
                public void onCancelled(DatabaseError databaseError) { }
            });
</code></pre>

<p>But when trying to do 'User this_user = dataSnapshot.getValue(User.class)' i get an error saying "User is missing a constructor with no arguments"</p>

<p>Any help would be great, thanks</p>