Metro Bundler immediately closes after react-native run-android
Environment
System:
OS: Windows 10
CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
Memory: 8.99 GB / 15.89 GB
Binaries:
Node: 10.16.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.16.0 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.9.0 - C:\Program Files\nodejs\npm.CMD
SDKs:
Android SDK:
Android NDK: 18.1.5063045
IDEs:
Android Studio: Version 3.3.0.0 AI-182.5107.16.33.5264788
react-native-cli: 2.0.1
react-native: 0.60.0
Description
Doing yarn react-native run-android opens the metro bundler but it immediately closes. Don't know if its a bug with the cli or the metro itself. This only happens on Windows, I think.
Things I have tried:
- Restarting my system
- Clearing cache etc.
Reproducible Demo
- Create a new project using
react-native init - Run
yarn react-native run-android
I'm not too sure if this is the correct solution but opening an new console and running
npx react-native start
works for me.
I had the same issue.The Metro runs on port 8081.But something else running was running on the port.I resolved by killing that process.refer https://reactnative.dev/docs/troubleshooting for more info
Was a permanent fix ever found for this problem, I'm still experiencing it. RN version : 0.71.8 RN CLI version: 2.0.1
Hey @MattNic2, mind upgarding to the latest version of RN? We fixed few things around starting packager in run-android.
For me, quitting the Docker solves my issue.