I'm doing a react-native app.
When I launch my app with react-native start or npm run start and react-native run-android, it install on my phone the app but don't launch it automatically and when I launch it by myself, I have this error :
Can you help me I don't know what is my problem ?
thank
I think your phone and your computer are not connected to the same network
Related
is there any way we can restart the device from react-native application?. I have done a research whether any npm module available to implement the same logic but unfortunately every npm modules is only to restart the application not the devices.
Anyone please help me to restart the device from react-native application? is there any npm module available for using?? or can we make use of native components??
A help would be really appreciable!! thanks in advance.
Dont you mean killing the port, and starting metro and running android again? i think its restarting..
like
npx kill-port thenumberWhichIsthePort
npx react-native start
npx react-native run-android
This is a strange error when I ran React Native (0.63.2) app on Android 8.1 emulator with
npx react-native run-android
Here is the full warning message:
warn No apps connected. Sending "devMenu" to all React Native apps failed. Make sure your app is running in the simulator or on a phone connected via USB.
info Opening developer menu...
Tried adb reverse tcp:8081 tcp:8081 but didn't help. The emulator was working fine. What can go wrong here?
Note: Answer targets only those visitors, who are facing this issue after successfully running once on device
npx react-native run-android
//once its installed on device next time just do
npx react-native start
installs app at your device on first run. I was facing same issue only when I tried npx react-native run-android second time.
So I used npx react-native start then
I just opened my latest app installed by last run and its working and showing me the updates as well
while running npx react-native run-android it shows an error
This issue is happening because you are connected with any Android device or any emulator, to connect with your emulator, you need to add a virtual device, to add a virtual device please follow these links https://developer.android.com/studio/run/managing-avds and https://developers.foxitsoftware.com/kb/article/create-an-emulator-for-testing-in-android-studio/
then run adb devices in your root-project in terminal, you must be able to run the app..
When I try to start my react-native init project with this command npx react-native start nothing happens in the emulator.
enter image description here
Command npx react-native start is for starting up the bundler (Metro)
to run it on an android emulator or device you need npx react-native run-android.
Before that please make sure you have either a real device connected or an emulator ready.
You can follow or check by using this guide for your Android environment setup.
I just started with react-native.
But I have a problem with the replay of the project. I use the command react-native run-android, this annoys me an error see capture.
The problem was resolution. I almost opened two console: one I compile with
npm start
and the other run
react-native run-android