can't run an new created app by react-native - reactjs

I've weird problem with react native. My first app worked great on emulator and building was fine but now when I tried to run my second app on emulator i reciving an error:
Could not connect to development server and possible fixes under it.
Why is this happening? I did all the same like last time when all worked.
Emulator is visible for adb:
C:\Users\Computer>adb devices
List of devices attached
emulator-5554 device
react-native run-android:
BUILD SUCCESSFUL
Total time: 41.496 secs
Running ANDROID_HOME=C:\Users\Bartas\AppData\Local\Android\sdk/platform-
tools/adb -s emulator-5554 reverse tcp:8081 tcp:8081
Could not run adb reverse: spawnSync
ANDROID_HOME=C:\Users\Bartas\AppData\Local\
Android\sdk/platform-tools/adb ENOENT
Starting the app on emulator-5554
(ANDROID_HOME=C:\Users\Bartas\AppData\Local\An
droid\sdk/platform-tools/adb -s emulator-5554 shell am start -n
com.auth/com.auth.MainActivity)...

Okey, asked question too fast on stack.. Soory..
The problem was that my var had that value:
'ANDROID_HOME=C:\Users\Bartas\AppData\Local\Android\sdk/platform- tools/adb'
Just deleted 'ANDROID_HOME=' part and it works again.

Related

Build is successful, everytime, however development server is closing

Build is successfully getting run but the development server is closing, as of that my React-native app is not able to run on emulator
You can check the error on the emulator, kindly do tell me the reason.
You could try adb reverse tcp:8081 tcp:8081 in cmd and it could help you.

React Native 0.60 connection to development server

(I'm almost a newbie in React Native development) today I have started a new project in React Native 0.60 (react-native init MyApp).
After that I typed : react-native run-android to check if everything worked.
After the bundle process is finished
I can finally get my welcome screen in my connected devices
But, if I try to reload the app from my devices I get this error:
How could I address this error ?
EDIT: Thank you for your answers, anyway, I have tried all solutions you suggest but I still get the same problem. I also noticed that when i run react-native run-android Metro Bundler (open in a new cli window) seems to start but it suddenly disappear. I think the problem could be with the message 'Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0'
react-native run-android not working in new react-native version
0.60
now you can use
react-native start
OR
npm start
both command is work
Please use the following two commands and then can start the react native again.
- adb reverse tcp:8081 tcp:8081
- killall node
Then you can run the following the command.
react-native start
Now you can run your application again.
Have a good day.
You need to connect your phone to the server, follow the below steps:
[For detailed help follow this https://facebook.github.io/react-native/docs/running-on-device]
1. Open the developer menu on phone.
2. Open 'Debug server host & port for device'.
3. Type in your machine's IP address and the port of the local dev server (eg. 10.0.1.1:8081). If you have connected over wifi then this will be your computers ip address. (If you are running in your computer I think instead of ip address it would be 'localhost:8081')
4. Go back to the Dev menu and select reload.
Hope it would help.
You need to run adb reverse in the Android Studio terminal so your device can connect to the server. Open Android Studio and click on the terminal button at the bottom. In the terminal, and with your device connected to your computer, enter the command adb devices. This will list the name of the connected Android device. Copy that name. Then enter this command adb -s <device name> reverse tcp:8081 tcp:8081. When you run that command replace <device name> with the name of your device you copied from the other command.
Here is a link to an explanation in the React Native documentation

adb stops working after running sshuttle

I recently bought a MacBook and migrated to macOS from Ubuntu. The surprise happens when I run sshuttle and begin ssh-tunneling in my mac. In Ubuntu, my adb continues to work perfectly but it's in macOS that adb stops working with the error error: protocol fault (couldn't read status): Undefined error: 0.
In my case, the problem was due to sshuttle. sshuttle automatically forwarded also localhost requests so the connection to adb was lost.
I cloned the repo and went back to ef83a5c and built the program again. this bug was found approximately two weeks ago partially fixed once and now it's again under development.
git clone https://github.com/sshuttle/sshuttle.git
git checkout ef83a5c
sudo ./setup.py install

Could not get BatchedBridge, make sure your bundle is packaged correctly happened on Android v4.4.2

I compiled react-native on Android v4.4.2 but the problems arised:
I tried to follow this solution, but I did not how to run on Command Prompt Windows 10:
$> cd myproject
$> react-native start > /dev/null 2>&1 &
$> curl "http://localhost:8081/index.android.bundle?platform=android" -o
> "android/app/src/main/assets/index.android.bundle
$> (cd android/ && ./gradlew assembleDebug)
I tried to compile the same way on Android V6.0. Then there was no problem at all.
How to make android V4.4.2 also can be use like Android v6.0 for my first react-native
project development?
That error means your React Native app can't fetch your JS files from your localhost. You'd usually just run react-native start to serve the JS files from your packager, but Android 4.4.x cannot connect to your localhost with the default adb reverse method.
The way I run on Android 4.4.x is to manually set the device to connect to my machine via Wi-Fi (Official guide here!).
Access the React Native dev menu by shaking your device or pressing the hardware menu button (can be done with Ctrl+M or Cmd+M in a simulator, IIRC)
Go to Dev Settings
Under the Debugging section, tap "Debug server host & port for device"
Enter your machine's IP address, as well as the port through which the React Native packager is serving, e.g. "10.0.0.25:8081" (make sure your device and your machine are on the same network!)
Reload through the dev menu again (or by pressing Ctrl+R or Cmd+R in a simulator, I think)
Try running this command
adb reverse tcp:8081 tcp:8081

BlackBerry 10 Cascades - Running app on the simulator

I am new to blackberry development and ran into this problem several times and cannot find a solution.
When I try to run an empty cascades project just with a simple HelloWorld label I get the following error
Deployment Failed: Info: Sending request: Install and Launch
Info: Action: Install and Launch
Info: Debug native: on
Info: File size: 190910
Info: Installing com.example.HelloWorld.testDev__HelloWorld7d1bfe91...
Info: Processing 190910 bytes
I'm using Momentics, VMware running BB10 Dev Alpha Sim and followed all the instructions here. http://developer.blackberry.com/cascades/documentation/getting_started/setting_up.html
I made sure my build config is set to Simulator-Debug and not even the example projects are able to run on the simulator.
Edit: I am not sure if this bit of info helps but when I try to run the application, the Progress hangs at 91% before the error dialog appears.
May be you are not setting the development Mode (like current Development Mode Simulator or Device) . I also getting the issue that Project Compile but not able to run on virtual Machine , today I sort the issue . check out the link http://supportforums.blackberry.com/t5/Native-Development/BB10-Native-Cascades-SDK-not-connecting-to-Alpha-BB10-simulator/td-p/1719865/page/5

Resources