Expo splash screen appear, but the app doesn't start

322 views Asked by At

When I open the app using Expo Go or a Development Build, I see the splash screen, but then nothing happens. After waiting for a few minutes, I tried stopping the server by pressing Ctrl + c, and I received an error message as shown below. However, after 1-2 seconds, the following error showed and the app suddenly closed.

I created the development build using the following commands:

$ npx expo prebuild --clean --yarn
$ npx expo run:android --variant debug

It's worth mentioning that everything works perfectly fine in the Android release build and the web build!

enter image description here

I'm using:

  • Expo SDK 49
  • expo-router 2.0.0
  • @react-navigation/drawer 6.6.4
  • react-native-reanimated 3.3.0
1

There are 1 answers

0
Mohammad Reza On

I ran yarn add @expo/metro-config then change my metro.config.js with:

const { getDefaultConfig } = require("expo/metro-config");

const defaultConfig = getDefaultConfig(__dirname);

defaultConfig.resolver.resolverMainFields.unshift("sbmodern");
defaultConfig.resolver.sourceExts.push("cjs");
defaultConfig.resolver.sourceExts.push("mjs");

module.exports = defaultConfig;

And then rebuild the project with npx expo run:android --variant debug