小编bea*_*ean的帖子

无法反序列化对象。没有定义无参数构造函数。如果您使用 ProGuard,请确保这些构造函数没有被剥离

我可以更新到 Firestore,但无法从我的文档中检索数据。我认为主要的问题是

无法反序列化对象。类 com.example.dotdot.Member 未定义无参数构造函数。如果您使用 ProGuard,请确保这些构造函数没有被剥离,这在 logcat 中显示。我不知道如何修复它。

我的代码 test.java:

public class test extends AppCompatActivity {
private EditText nameinput;
private EditText passwordinput;
private EditText phoneinput;
private TextView getinfo;

private FirebaseFirestore db = FirebaseFirestore.getInstance();
private DocumentReference accountRef = db.collection("Member").document();
private CollectionReference memRef = db.collection("Member");
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_test);

    nameinput = findViewById(R.id.name);
    passwordinput = findViewById(R.id.password);
    phoneinput = findViewById(R.id.phone);
    getinfo = findViewById(R.id.getinfo);
}
public void insertAccount(View v){
    String name = nameinput.getText().toString();
    String password = passwordinput.getText().toString();
    String phone = phoneinput.getText().toString(); …
Run Code Online (Sandbox Code Playgroud)

java android firebase google-cloud-firestore

5
推荐指数
1
解决办法
5459
查看次数

标签 统计

android ×1

firebase ×1

google-cloud-firestore ×1

java ×1