0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Expo SDK39をejectしてAsyncStorageの内容が消えた時の対象法

Posted at
1 / 2

Expo sdk39のReact-native アプリをejectしたら、AsyncStorageの内容がクリアされる問題に遭遇しました。

原因

Expo下で参照されるAsyncStorageのデータ保存場所と、Eject後のAsyncStorageの保存場所が異なることから発生する問題のようです:frowning2:

解決方法 ※2021年3月22時点

今回は@react-native-community/async-storageを使ってやってます。
iexplorer等のツールを利用して保存元のファイルがどこにあるのか
確認して保存元のファイル名を変更すると問題なく引き継がれます。

例:expoでの保存先がRCTAsyncLocalStorageの場合

RNCAsyncStorage.m
static NSString *const RCTStorageDirectory = @"RCTAsyncLocalStorage_V1";  //保存先
static NSString *const RCTOldStorageDirectory = @"RNCAsyncLocalStorage_V1"; //保存元
RNCAsyncStorage.m
static NSString *const RCTStorageDirectory = @"RCTAsyncLocalStorage_V1";  //保存先
static NSString *const RCTOldStorageDirectory = @"RCTAsyncLocalStorage"; //保存元

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?