错误是:
D/ShopsCollectionDisplaye: FromDBToShopsCollection: Doc{id=shop_test_Fb_1, shopImg=2131165326}
D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.app.tacaalacaraman.wortheat, PID: 10527
java.lang.RuntimeException: Could not deserialize object. Failed to convert value of type java.lang.Long to String (found in field 'shopImg')
现在,我的应用使用字符串,程序也使用字符串,但是我的Android设备无法更新代码或类似的内容
答案 0 :(得分:0)
最后是因为Firestore在缓存(持久性)中使用了db。所以我不得不用FirebaseFirestoreSettings
禁用Persistance:
private FirebaseFirestore db = FirebaseFirestore.getInstance();
private FirebaseFirestoreSettings settings = new FirebaseFirestoreSettings.Builder()
.setPersistenceEnabled(false)
.build();
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
....
db.setFirestoreSettings(settings);
....