Summary
I currently have a production build of an iOS app in the app store using SDK 45 built using the Classic Build Method. Recently I updated to SDK 47 to take advantage of EAS Build.
After upgrading the app to SDK 47 and building using EAS Build I published my app to TestFlight for internal testing. However, the user data from AsyncStorage and SecureStore does not transfer between the versions. The EAS built app no longer has any access to the previous information stored in AsyncStorage and SecureStore.
Building the app with Classic Build method and publishing it to TestFlight retains the user data.
Things I Tried
I originally though it had something to do with the iOS Entitlements, as the keychain-access-groups was missing from the iOS entitlements. Adding keychain-access-groups in the app.json did not solve the issue.
"entitlements": {
"keychain-access-groups": ["XXXXXXXX.*", "com.apple.token"]
}
Discussion
Could this issue still be a factor of how the entitlements are structured between the build methods. I noticed a discrepancy between the entitlements group when building the app with Classic and EAS methods. In the example below we can see that the Classic Build entitlements group is “ExpoKitApp.app/CaMyAppTest” (which is my Bundler Identifier). However, in the EAS build the entitlements group is MyApp.app/MyApp (which is the slug/name of my app).
Similar Issues
This issue is not new I have found other users having the same issue.
- forums.expo.dev/t/eas-build-cleared-the-local-storage-data/63966
- forums.expo.dev/t/securestore-and-asyncstorage-empty-in-new-binary/61109
- EAS build: SecureStore returns null for all keys after upgrading to a binary built with EAS #16175
What platform(s) does this occur on?
iOS
SDK Version
47
Environment
expo-env-info 1.0.5 environment info:
System:
OS: Windows 10 10.0.22000
Binaries:
Node: 16.16.0 - C:\Program Files\nodejs\node.EXE
npm: 8.3.0 - C:\Program Files\nodejs\npm.CMD
npmPackages:
expo: ^47.0.0 => 47.0.8
metro: ^0.73.4 => 0.73.4
react: 18.1.0 => 18.1.0
react-dom: 18.1.0 => 18.1.0
react-native: 0.70.5 => 0.70.5
react-native-web: ~0.18.7 => 0.18.10
react-navigation: ^4.4.4 => 4.4.4
Expo Workflow: managed
Minimal reproducible example
- Create a new app that uses AsyncStorage and SecureStore on SDK <47 e.i. SDK 45
- Build the application using expo build (Classic Build)
- Publish the application to TestFlight and install it on a device
- Store something to AsyncStorage and SecureStore in the app
- Update app to use SDK 47
- Build the application again with eas build
- Publish the application to TestFlight and update the app on the device to the new version
- Try to get the information stored in previous version, it returns null
- Downgrade app to use SDK <47 e.i. SDK 45
- Try to get the information stored in, it returns null