Using AsyncStorage in Apploading will cause SplashScreen stuck sometime in Android


  Expo CLI 3.4.1 environment info:
      OS: Linux 5.0 Ubuntu 18.04.3 LTS (Bionic Beaver)
      Shell: 4.4.20 - /bin/bash
      Node: 10.17.0 - ~/.nvm/versions/node/v10.17.0/bin/node
      npm: 6.11.3 - ~/.nvm/versions/node/v10.17.0/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
      Android Studio: 3.5 AI-191.8026.42.35.5977832
      expo: ^35.0.0 => 35.0.0 
      react: 16.8.3 => 16.8.3 
      react-native: => 0.59.8 
      react-navigation: ^4.0.10 => 4.0.10 

Question Description

I use ComponentDidMount to read something from AsyncStorage in Apploading, such as:

class Loading extends React.Component {
  ComponentDidMount() {
    AsyncStorage.multiGet(["a", "b", "c"]).then( data => {
      return routeName;
    }).then( routeName => {
 render() {
    return (
    <Apploading {autoHideSplash={false}} />

And then, I will call SplashScreen.hide in the routeName page.

What’s the error?

Actually, it works well for the most time. But it will stuck in SplashScreen a lot of time in Android for sometime. What’s the problem? Is there any conflict between SplashScreen and Asynctorage in the underlayer?

Some reference

I also try to issue it and search some materials. May it help? But I don’t know a lot for the underlayer.

It looks like a bug for AsyncStorage. And react-native-community/async-storage has fix it, but as an Expo user, what should I do?

1 Like

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