React-Native AsyncStorage.clear() is failing on IOS

前端 未结 2 2059
失恋的感觉
失恋的感觉 2021-02-08 01:34

I\'m using AsyncStorage.clear() which is working just fine on Android but when run using iOS platform (real device) I\'m getting this error and can\'t find anything

2条回答
  •  伪装坚强ぢ
    2021-02-08 02:04

    I think it's crappy that clear throws an exception when the storage has never been used; at least that is what I'm thinking is the case?

    So to move on I modified code removing the use of .clear() and replacing it with AsyncStorage.getAllKeys().then(AsyncStorage.multiRemove)

    I'd still like an reason if anyone knows what is going on.

提交回复
热议问题