SecureStore and AsyncStorage empty in new binary

Please provide the following:

  1. SDK Version: 44
  2. Platforms(Android/iOS/web/all): Android/iOS

Hey, I’m updating my app from SDK version 38 to 44. When I upgrade the app from the App Store/Google Play on a device, the data from SecureStore and AsyncStorage is no longer accessible. The SecureStore returns null for a key that returned OK in the version which was previously installed on the device.

Some additional information:

  • The apps were installed from TestFlight/Internal Testing tracks on top of the ones from App Store/Production tracks
  • The applications run perfectly in Expo Go on both platforms and build goes through ok
  • The last version was built with the old expo build, the new version using EAS
  • My last successful build which is currently in the app stores is built on Aug 17, 2020 with the same Expo account
  • iOS distribution certificate was expired when I started to run the builds so it was regenerated

What might cause this data loss? Is there any way for me to prevent this data loss on the app users? It could be quite catastrophical for some.

Hey @numsu, did you make any changes to the bundleIdentifier value?

Thank you for your response. No, the only things that have changed in my app.json are:

  • expo.version
  • expo.ios.buildNumber
  • expo.ios.infoPlist

My project is open source, the diff of all the changes I’ve made to the current production version can be seen here, if they are of any help.

@adamjnav Have you got any guesses on what other things could cause this or anything I could do about it?

It seems like the name/location of the database might have changed. I haven’t tested this myself, but I suspect the database name is different between an app built with expo build and eas build.

Although the following is about ejected/bare apps, maybe it will point you in the right direction:

A paragraph from the Expo SDK 41 release notes about AsyncStorage:

Along with this superficial change in package names comes a fix for an issue that occurs when ejecting your project; more information in this issue and these pull requests.

@adamjnav is the AsyncStorage filename/path different for a classic standalone app vs. one built with EAS Build?

EDIT: @numsu maybe you could try creating a new app that makes use of AsyncStorage. Then build it with expo build and store something. Then build it with eas build and try to access that data. Then re-install the version that was built with expo build to see if the data is available again. Based on the above you could perhaps create an issue on GitHub with all the details.

Thanks for the response @wodin.

I’ve trialed this a bit further now and found out that this doesn’t affect AsyncStorage. Those issues came after running several different SDK versions on my phone which messed up the storage.

However this issue does affect SecureStore. On an identical app built with expo build, I can access the data, but with the app built with eas build I cannot. I opened an issue about this.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.