You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
在Android上使用持久化储存的 AsyncStorage 时,发现catch到一个错误:database or disk is full,这个让我陷入沉思,我存了啥进入?不就是几百个远程链接的图片(80*80)转成的base64码??然后经过查看参考链接后,发现 react-native 在 Android 上设置了默认的 AsyncStorage 的大小限制(6M)
问题发生时相关组件版本
react-native 0.56.0
react 16.4.1
react-native-storage
发生设备
Google Nexus 5x (android 7.1.0, API 25 1080 * 1920)
问题描述
在Android上使用持久化储存的 AsyncStorage 时,发现catch到一个错误:
database or disk is full
,这个让我陷入沉思,我存了啥进入?不就是几百个远程链接的图片(80*80)转成的base64码??然后经过查看参考链接后,发现 react-native 在 Android 上设置了默认的 AsyncStorage 的大小限制(6M)问题发生时相关组件版本
发生设备
Google Nexus 5x (android 7.1.0, API 25 1080 * 1920)
代码
无
参考链接
react-native #3387
参考链接即可解决
我是在
MainActivity.java
的onCreate
方法中加的:2018-09-13 23:00:29 补充
近期又遇到和AsyncStorage存储相关的问题了,故补充
单条数据组存储大小不能大于 2M, 如果超过 2M 就会catch到一个错误:
Couldn't read row 0, col 0 from CursorWindow.
参考链接
react-native #12529
更深入了解 2M 大小限制的问题
解决办法
因为我单条数据很大的原因是,单条数据中存储了多个图片的base64码,所以用 rn-fetch-blob 下载图片,单条数据中仅存储返回的本地图片路径即可
The text was updated successfully, but these errors were encountered: