世博会卡在加载屏幕上没有错误

时间:2021-05-25 16:39:05

标签: javascript reactjs react-native expo

我运行 expo start --ios 并出现启动画面,显示应用已 100% 加载,但模拟器在加载时卡住。我已经清除了模拟器中的缓存,并进行了全新的 npm 安装并预先删除了 package-lock.json。我已经用谷歌搜索过了,我没有使用 facebook 登录或任何东西来导入世博会。我不知道这是从哪里来的。

它吐出的只有3行代码是:

[Unhandled promise rejection: ReferenceError: Can't find variable: Expo] //in yellow
at App.js:98:14 in componentDidMount //these are green
at [native code]:null in flushedQueue
at [native code]:null in callFunctionReturnFlushedQueue

app.js

  async componentDidMount() {

    try {
      const update = await Updates.checkForUpdateAsync();
      if (update.isAvailable) {
        await Updates.fetchUpdateAsync();
        // ... notify user of update ...
        await Updates.reloadAsync();
      }
    } catch (e) {
      // handle or log error
      console.log(`update his an error ${e}`)
    }

    await Expo.Font.loadAsync({
      Roboto_medium: require("native-base/Fonts/Roboto_medium.ttf"),
      ssb_Bold: require('./assets/font/Source_Sans_Pro/SourceSansPro-Bold.ttf'),
      ssb_Regular: require('./assets/font/Source_Sans_Pro/SourceSansPro-Regular.ttf'),
      ssb_Light: require('./assets/font/Source_Sans_Pro/SourceSansPro-Light.ttf'),
      ssb_SemiBold: require('./assets/font/Source_Sans_Pro/SourceSansPro-SemiBold.ttf'),
      SimpleLineIcons: require('native-base/Fonts/SimpleLineIcons.ttf'),
      Ionicons: require('native-base/Fonts/Ionicons.ttf'),
      'Material Icons': require('native-base/Fonts/MaterialIcons.ttf'),
    });

    await firebase.auth().onAuthStateChanged((user) => {
      if (user !== null) {
        this.setState({
          isLogged: true,
          loaded: true
        });
      } else {
        this.setState({
          isLogged: false,
          loaded: true
        });
      }
    })

    
  }

0 个答案:

没有答案