I have a problem, it's about saving data and then reading them through the firestone, at the time of saving it does it well, but when I want to see what the app saves, it closes, I do not know much about the app.
package com.example.luis.myapplication;
import java.io.Serializable;
public class Product implements Serializable {
private String name, brand, description;
private double price;
private int qty;
public Product(String name, String brand, String description, double price, int qty) {
this.name = name;
this.brand = brand;
this.description = description;
this.price = price;
this.qty = qty;
}
public String getName() {
return name;
}
public String getBrand() {
return brand;
}
public String getDescription() {
return description;
}
public double getPrice() {
return price;
}
public int getQty() {
return qty;
}
}
in the logcat among so many codes I get this ...
java.lang.RuntimeException: Could not deserialize object. Class com.example.luis.myapplication.Product does not define a no-argument constructor. If you are using ProGuard, make sure these constructors are not stripped
at com.google.firebase.firestore.util.CustomClassMapper.deserializeError(com.google.firebase:firebase-firestore@@17.1.2:524)
at com.google.firebase.firestore.util.CustomClassMapper.access$100(com.google.firebase:firebase-firestore@@17.1.2:53)
at com.google.firebase.firestore.util.CustomClassMapper$BeanMapper.deserialize(com.google.firebase:firebase-firestore@@17.1.2:680)
at com.google.firebase.firestore.util.CustomClassMapper$BeanMapper.deserialize(com.google.firebase:firebase-firestore@@17.1.2:674)
at com.google.firebase.firestore.util.CustomClassMapper.convertBean(com.google.firebase:firebase-firestore@@17.1.2:503)
at com.google.firebase.firestore.util.CustomClassMapper.deserializeToClass(com.google.firebase:firebase-firestore@@17.1.2:242)
at com.google.firebase.firestore.util.CustomClassMapper.convertToCustomClass(com.google.firebase:firebase-firestore@@17.1.2:97)
at com.google.firebase.firestore.DocumentSnapshot.toObject(com.google.firebase:firebase-firestore@@17.1.2:203)
at com.google.firebase.firestore.QueryDocumentSnapshot.toObject(com.google.firebase:firebase-firestore@@17.1.2:121)
at com.google.firebase.firestore.DocumentSnapshot.toObject(com.google.firebase:firebase-firestore@@17.1.2:183)
at com.google.firebase.firestore.QueryDocumentSnapshot.toObject(com.google.firebase:firebase-firestore@@17.1.2:101)
at com.example.luis.myapplication.ProductsActivity$1.onSuccess(ProductsActivity.java:55)
at com.example.luis.myapplication.ProductsActivity$1.onSuccess(ProductsActivity.java:43)
at com.google.android.gms.tasks.zzn.run(Unknown Source)
at android.os.Handler.handleCallback(Handler.java:761)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:156)
at android.app.ActivityThread.main(ActivityThread.java:6523)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:942)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:832)
among so many codes I get this ...