React-native Timeout when connecting to remote debugger in windows - android

I am new to React-Native and android app development as a whole. While i try to run remote debugger in Android Emulator (Pixel 2 phone), I get the following error in the emulator:
Then after, even if I stop remote debugging, the application won't run on the emulator (i.e. nothing is rendered into the emulator screen). I need to run the project again.
Following is the auto-generated debugger URL: http://10.0.2.2:8081/debugger-ui
How can I Fix this problem?

http://10.0.2.2:8081/debugger-ui This is internal IP the Android VM, with your browser use localhost:8081/debugger-ui reference https://github.com/facebook/react-native/issues/16674#issuecomment-376774645

uninstall your application, then run => react-native run-android in terminal then click debugging end in chrome replace http://localhost:8081/debugger-ui/, end run react-native run-android. if you still haven't succeeded try again

Related

How to run react-native expo app on multiple emulators?

Does anyone know how to run an expo react-native app on multiple android emulators at once?
I have tried to run the app after running the emulators but it would run only on one emulator.
When I tried 'shift+a' it shows a list of emulators but when I choose the desired emulator it doesn't work.
This is the error 'Couldn't start a project on Android: The emulator (Nexus_S_API_30) quit before it finished opening. You can try starting the emulator manually from the terminal with: emulator #Nexus_S_API_30'
This says the emulator exited even though it is already running.
Install app in all emulator
Open all emulator
Run project from different port
For example
Run 'npx react-native start' for first emulator
Run 'npx react-native start --port 9988' from another terminal for second emulator etc
Open app from emulators
Open developer menu by pressing ctrl + m
Change bundle location to '10.0.2.2:PortNumber' eg : '10.0.2.2:9988'

can't connect to development server when running react native app on nox emulator

have to say that running on a real devices works
so I tried the following things:
I ran nox_adb.exe connect 127.0.0.1:62001
I ran react-native run-android
the app installed on the device but didn't open the app
and navigated to http://192.168.14.130:8081/ with the browser on the emulator (192.168.14.130 -is my
local ip)
opened the app and enabled hot reloading
reloaded and still got the error
tried restarting the app and navigating to the same url but nothing
tried navigating to http://192.168.14.130:8081/index.delta?platfrom=android&dev=ture&minify=false - but got bundling failed: Error: Unable to resolve module AccessibilityInfo ... This might be related to https://github.com/facebook/react-native/issues/4968
did the steps mention but nothing
tried runing react-native run-android --deviceId 127.0.0.1:62001 instead of react-native run-android, nothing special happened
I have the following setup
React Native version: 0.57.7
OS: Windows 10
Nox Player version: 6.2.5.2
so I tried few more emulators: blue stacks 4 and andy
and with andy emulator it works like a charm, it has os 7.1.2, and nox player runs on 4.4, I think this is the reason why it works
andy emulator

Nox emulator with React Native

I'm setting up my development environment for React Native with a custom Android Emulator (Nox).
I followed the steps on this website:
How to connect Android Studio with Nox App Player
But when I type: adb devices it still shows nothing.
So when I try to run my app with react-native run-android it says that there is no Android simulator running.
Is there something I missed or someone with the same problem?
Open terminal and type adb connect 127.0.0.1:62001. type adb devices to make sure your emulator is connected.
Go to your project, type react-native run-android --deviceId 127.0.0.1:62001, waiting for the project to finish compiling, and the you will see a red error screen.
Open the developer menu, Go to Dev Settings → Debug server host for device, Assume your local ip is 192.168.1.121, then type: 192.168.1.121:8081
Use developer menu to reload your app,then close the app, and reopen it.
Open terminal and type adb connect 127.0.0.1:62001. type adb devices
to make sure your emulator is connected.
Go to your project, type react-native run-android --deviceId 127.0.0.1:62001, waiting for the project to finish compiling, and then you will see a red error screen.
Open the developer menu, Go to Dev Settings → Debug server host for device, Assume your local ip is 192.168.1.121, then type:
192.168.1.121:8081
Use developer menu to reload your app,then close the app, and reopen it.
Just in step 2 type react-native run-android (if you don't work with android >10 add prefix) --no-jetifier. It works for me!
it mean for android v 4.1.1 in nox emulator adb connect 127.0.0.1:62001
for android v 5.1.1 in nox emulator adb connect 127.0.0.1:62025
adb connect localhost:62001
react-native run-android --deviceId localhost:62001

react-native run-android: usb debugging not working

I have installed the development environment for react native on Windows 7 using the instructions here.
I have installed the following packages:
Python 2.7
node 4.2.4
npm 2.14.12
react-native-cli 0.1.10
react-native 0.18.0-rc
Android SDK
I can generate a skeleton project using the command react-native init Test.
However, when I execute the command react-native run-android, the following error occurs: Unable to install path\to\app-debug.apk.
The device, a Samsung Galuxy running Android 5.0.1, is connected to my PC and USB debugging on the phone has been enabled. When I type adb devices the phone appears in the list.
I can download the apk to the phone manually using the command adb install. However, when I run the app, a red screen appears with the error "Unable to download js bundle." This error persists even after I do the following:
Start the local development server using react-native start
Executing the command: adb reverse tcp:8081 tcp:8081
On the phone, setting the debug server host and port to localhost:8081
Update: I have solved one problem by downloading gradle to version 1.2.3 as described here. However, the red screen still appears with the error Unable to download js bundle.
What could be the problem?
You are working fine. for this problem have added the IP address in device Setting server host. one more thing your machine and device should have on same network.

How to set the default Android Emulator

I am building an app with NativeScript, where I run:
$ tns run android --emulator
to build the app and launch it in an emulator. When I do this, the default android emulator boots on my machine, which is unusably slow...
In all the demos, they are using the Genymotion Emulator. I have installed this, but the NativeScript command still launches the default emulator. How do I get this to launch on the genymotion emulator?
NB: I am using Windows 10
Update:
Even if I run the command with the Genymotion emulator running (and nothing else), I get the following log output and a new terminal window is opened running android-sdk/tools/emulator-arm.exe
BUILD SUCCESSFUL
Total time: 11.959 secs
Project successfully built.
Using C:\Users\George\Source\Repos\NativeScript-App\Bluetooth\platforms\android\build\outputs\apk\bluetoothdemo-debug.apk
Starting Android emulator with image Xamarin_Android_API_23
That looks as though it is referencing the emulator I had been using when I was developing with Xamarin. Any ideas where I can change that, or why that is being called?
start Genymotion, then start one of the devices that you have setup in Genymotion
then check that the device is seen:
$ tns device
then run nativescript like so
$tns run android --geny 192.111.222.33:555
(or whatever is the name that you get from the tns device command)
To my experience --emulator always tries to start the stock emulators. Try to start genymotion and then just tns run android (w/o the --emulator option).
I think it does that when there is no emulator running.
Try starting Genymotion first, launch the image you want, then run the "tns run adroid" command.
I had a similar issue.
To use GenyMotion by default, first delete all the Android emulators using
android avd
I then followed the solution on this thread:
React-Native, Android, Genymotion: ADB server didn't ACK
Edit the settings in GenyMotion to use the android SDK you downloaded. (path for Windows is Users/YOUR-SYSTEM/AppData/Local/Android/android-sdk)
You still have to run the device on GenyMotion before running the emulator
tns run android

Categories

Resources