I am developing a react-native app with AWS amplify. There was any problem but I suddenly got the error below as soon as I started the app. (Only android so far)
AsyncStorageCache - Failed to set item Error: database or disk is full (code 13 SQLITE_FULL)
Even if I search my entire source code, AsyncStorage is not used. I searched and found out that Amplify uses it.
So, I solved the problem through the code below.
let listKey = [];
const allKeys = await AsyncStorage.getAllKeys();
for (const key of allKeys) {
if (key.includes('@AmplifyDatastore')) listKey.push(key);
}
const res = await AsyncStorage.multiRemove(listKey);
I have a question here.
- Do I always have to run the code above? (App.js etc.) I'm not sure but this doesn't seem like a good way to do it.
- However, if I don't make any preparations, customers will experience problems while using the app. Please advise on how to handle it other than Question 1.
Thank you.
This issue expect to happen to certain devices which run out of memory: