I followed this official help page and also consulted this previous SO question.
But I still don't know what is wrong here.
Let's take step by step:
Ensure the package server is running. From the screenshot, you can see the command I typed "react-native run-android" and the reponse "Starting JS server..."
Ensure your device is connected... Yes, Vysor sees my device. Wee see Vysor showing the app running in the screenshot.
...USB enabled Yes, the app is running, that's why we see the red error screen, but it's the app running nevertheless.
Run "adb reverse tcp:8081 tcp:8081" Yes, the screenshot shows that I ran the command.
Device and port... Yes, did that too. See next screenshot
What am I still doing wrong? How can I make it work?
React Native For Absolute Beginners with React HooksWe can run the React Native app on Android platform by running the following code in the terminal. Before you can run your app on Android device, you need to enable USB Debugging inside the Developer Options.
react-native run-android Before you can run your app on Android device, you need to enable USB Debugging inside the Developer Options. When USB Debugging is enabled, you can plug in your device and run the code snippet given above. Make sure your laptop and your phone are on the same Wi-Fi network.
With React Native for Web, developers can write a single React Native application that can run natively on Android and iOS, as well as on a web browser using standard web technologies.
npm run start
in one console window to start the react-native development server.react-native run-android
.I sometimes ran into problems if I don't start the development server in a separate console window.
Further notes:
$ adb devices
in your console.adb reverse tcp:8081 tcp:8081
only works for Android versions 5.0 and up.Could you provide us the screenshot of React Packager - run 'npm start' before doing 'react-native run-android'.
I am using Visual Studio Code with React Native tools extension that takes care of port forwarding, deploying the app to device/emulator and it works okay - I get similar screen at start, but clicking 'Reload' takes care of it.
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