After creating react native app when i used to run this using react-native run-android that time i am getting error as root missing
error Option "--root" is missing. Run CLI with --verbose flag for more details. Error: Option "--root" is missing at C:\Users\Mayuri\AppData\Roaming\npm\node_modules\react-native\node_modules@react-native-community\cli\build\tools\assertRequiredOptions.js:51:13
Running your app on Android devices 1 Enable Debugging over USB Most Android devices can only install and run apps downloaded from Google Play, by default. ... 2 Plug in your device via USB Let's now set up an Android device to run our React Native projects. ... 3 Run your app
That should do it This error simply means you don't have 'android' and 'ios' folders in your root directory of the project. Their location is important. Open your project folder search for 'android' and iso 'folder', move these folders in your root folder of the project and then start the project with react-native run-android
Open the command prompt and type ipconfig to find your machine's IP address ( more info ). Make sure your laptop and your phone are on the same Wi-Fi network. Open your React Native app on your device. You'll see a red screen with an error.
Actually running react-native upgrade command restore those files, thus fixing the problem. As a complement, in the case react-native command is not found, you should install react-native CLI: Then you can follow the steps people said above.
If you are using the latest version of react-native 64 and npm greater than 5.2 you need to execute your packages using npx command so rather than running
react-native run-android
run
npx react-native run-android
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With