Firebase “User is missing a constructor with no arguments”

后端 未结 4 2067
不知归路
不知归路 2020-12-14 18:28

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          


        
4条回答
  •  时光说笑
    2020-12-14 19:07

    You must be getting this error because your User class is a sub class.

    Solution:

    Either mark your class static:

     public class SomeParentClass{ 
    
            public static class User {
                ....
            }
        }
    

    or create it in a separate file.

提交回复
热议问题