React native 提供给SecureStore的值无效。值必须是字符串;如果JSON是可序列化的,请考虑对其进行编码。

React native 提供给SecureStore的值无效。值必须是字符串;如果JSON是可序列化的,请考虑对其进行编码。,react-native,expo,React Native,Expo,尝试将值存储到expo SecureStore,但出现此错误 Invalid value provided to SecureStore. Values must be strings; consider JSON-encoding your values if they are serializable. - node_modules\expo-secure-store\build\SecureStore.js:25:14 in setItemAsync$ - node_modules\reg

尝试将值存储到expo SecureStore,但出现此错误

Invalid value provided to SecureStore. Values must be strings; consider JSON-encoding your values if they are serializable.
- node_modules\expo-secure-store\build\SecureStore.js:25:14 in setItemAsync$
- node_modules\regenerator-runtime\runtime.js:45:44 in tryCatch
- node_modules\regenerator-runtime\runtime.js:271:30 in invoke
- node_modules\regenerator-runtime\runtime.js:45:44 in tryCatch
- node_modules\regenerator-runtime\runtime.js:135:28 in invoke
- node_modules\regenerator-runtime\runtime.js:170:17 in <unknown>
- node_modules\promise\setimmediate\core.js:45:7 in tryCallTwo
- node_modules\promise\setimmediate\core.js:200:23 in doResolve
- node_modules\promise\setimmediate\core.js:66:12 in Promise
- node_modules\regenerator-runtime\runtime.js:169:27 in callInvokeWithMethodAndArg
- node_modules\regenerator-runtime\runtime.js:192:38 in enqueue
- node_modules\regenerator-runtime\runtime.js:216:8 in <unknown>
- node_modules\expo-secure-store\build\SecureStore.js:22:7 in setItemAsync
* src\context\AuthContext.js:32:37 in _callee$
- node_modules\regenerator-runtime\runtime.js:45:44 in tryCatch
- node_modules\regenerator-runtime\runtime.js:271:30 in invoke
- ... 13 more stack frames from framework internals

转换必须在发送friend变量之前完成,即使是JSON(),它也遵循它的外观


等待SecureStore.setItemAsync('email',JSON.stringify(response.data.email))

您可以添加响应、数据、电子邮件的屏幕截图吗?您可以提供更多详细信息,比如这是警告还是错误?我确实遇到过这样的问题,但取决于解决方案的类型。
await SecureStore.setItemAsync('email',response.data.email);