unable to connect with remote debugger unexpected end of stream on connection issue in react-native(android) in linux - react-native

When I am trying to connect to remote debugger it shows following error.
react version: 16.3.1,
react-native version : 0.55.2
tried with adb reverse tcp:8081 tcp:8081 and react-native start,but when I select the debug window still showing the above error.

Try to add your ip-address:8081 in Dev setting ==> debug server host and port for device...

Related

React Native, wireless connection to Android TV: stuck at error = adb.exe: error: more than one device/emulator

I have an Android TV box, it only has USB A ports, so I'm trying to work with it over Wifi.
I use adb connect 192.168.0.211 to make the TV box show up in adb devices
I try to use npx react-native run-android to deploy
I get the error:
info Connecting to the development server...
adb.exe: error: more than one device/emulator
warn Failed to connect to development server using "adb reverse": Command failed: C:\Users\admin\AppData\Local\Android\Sdk\platform-tools\adb -s 192.168.0.211:5555 reverse tcp:8081 tcp:8081
info Starting the app on "192.168.0.211:5555"...
Starting: Intent { cmp=com.tv_test/.MainActivity }
It seems to boil down to the command adb -s 192.168.0.211:5555 reverse tcp:8081 tcp:8081 which, when I run it, fails with the message:
adb.exe: error: more than one device/emulator
.. even though it's the only device in adb devices and even though I used -s to specify the device.
Nothing I googled worked so far, so I'm asking here.
How do I get adb to run that command on/for a wifi connected device?

Adb reverse on FireTV fails with error: more than one device/emulator

Running a React Native application with Leanback on Firestick.
This only happens on Firetv stick 4k. I am pretty sure I have only one device connected
$ adb devices
List of devices attached 10.x.x.x:5555 device
I have no problems running the same on Chromecast. There are no Firewall restrictions.
The error I get is:
adb: error: more than one device/emulator
warn Failed to connect to development server using "adb reverse": Command failed: adb -s 10.x.x.x:5555 reverse tcp:8081 tcp:8081

Expo start shows "Starting Metro Bundler on port" forever

I am working on react native project.
It worked well before I reinstall computer OS.
Now if I run expo start it just show this.
Starting Metro Bundler on port 19001.
This takes forever.
If I run android emulator here, then this error appears.
Couldn't start project on Android: could not install *smartsocket* listener:
cannot bind to 127.0.0.1:5037: Only one usage of each socket address
(protocol/network address/port) is normally permitted. (10048)
could not read ok from ADB Server
* failed to start daemon *
error: cannot connect to daemon
What's wrong here? I am using Genymotion simulator.
I solved this.
I just set path environment to genymotion adb tool directory.
C:\Program Files\Genymobile\Genymotion\tools
And now it works well.
Thanks.

How does the "Reload" work in react-native when running on a physical android device?

When the RN app is run on an android physical devices and the adb is connected over USB how does the "Reload" on the app fetches the files saved on the development project directory. How does the App knows the ip address of the development machine ?
First if you have real device type this code: react-native run-android --deviceId [YOUR ID]
If you want debug the app through Wifi you must first find your ip and then in adb type:
adb tcpip 5555
adb connect [YOUR IP]
Then type react-native run-android --deviceId [YOUR ID] again with your new id ([your device ip]:5555)
For the first time your app will be built. But for reload index.js open dev menu , go to dev setting in Debug server host & port for device type [YOUR PC IP]:8081
When the application is started the react-native run-android ... command does the reverse(forwarding the ports) of the ports using the following command which is visible in node start logs.
adb -s [device_id] reverse tcp:8081 tcp:8081
So after this when the "RR" command is received by the RN app, it loads the page from the localhost (http://localhost:8081/xyz.js?foo...) which is being forwarded to the development host.

Could not connect to development server on android emulator and on real device

When I run "react-native run-android",it gives me error:"could not connect to development server...".-- The red screen
OS: Windows 7
node version:8.2.1
npm version:4.1.2
react-native version:0.47.1
react-native-cli version:2.0.1
android device and emulator version: 5.1.1
i followed following command:
react-native init ProjectName
cd ProjectName
react-native run-android
And this makes the package server run automatically.
But I am not able to access the package server from browser on the machine and the mobile.
My android device connected to computer has debugging enabled i checked it using adb devices command.
Usb debug is on.
I tried running the project on real device and on emulator. On Both I got error: "Unable to load script from assets 'index.android.bundle' Make sure your bundle is packaged correctly or you're running a package server'.
reloading i get the error: "Could not connect to development server."
Then i set the host and port number on development setting on both and got the error "Could not connect to development server."
enter image description here
So how to fix the red error screen issue?Any suggestion is appreciated!
Try to open this link in browser. It will automatically bundle the assets.
http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false
You development server should be running while running this command.