Expo & Metro Bundler crash when attempting to open on Android Emulator - android

On a react-native project, since a few hours, I have a huge issue : Expo doesn't want to open my App on my android emulator.
I'm doing : expo start in the terminal,
I have the terminal interface with the QR Code
And when I press a to open on android, in my terminal I can see Opening on Android... and nothing happens
So I've tried to use the Metro Bundler graphic interface in the web browser to open my app and when I click on the button Run on Android device/emulator, I can see the message Attempting to open a simulator and nothing happens.
I've restarted my computer many times, I've tried npm run --clear-cache, expo r -c and still, nothing happen when I want to open my App on my emulator.
4 hours of trying to solve this and I found no solutions...
EDIT : I can use my Application on my iPhone using the Tunnel connexion
EDIT : When I try to open the Application on an android emulator, expo crashes. I can't even close it with CTRL+C on the terminal

Related

Emulator not starting automatically when running react native project in webstrom or VS code terminal

Every time if I want to run RN project I want to start an android studio and start the emulator manually and then go to the terminal and run the RN. if i run the project without starting an emulator it's giving me an error.
error I got when I run the project without starting an emulaotr
from my experience this is expected behavior. On Mac, running an iOS project is able to open the built in emulator, but never on Android. The error is just letting you know there are no devices running.
One helpful thing you can do is create a shortcut or terminal command to open your emulator without opening Android Studio, which is kind of a pain to open just to start an emulator. You can do this using something like what is mentioned here: https://stackoverflow.com/a/33487044/3218158

Could not start emulator within 30 seconds

I'm new to react-native, Android studio(for testing purposes).
What I'm trying to do?
well, I have build an a react native app using create-react-native and then I got the app, I've installed Android-studio then, No Issue.
what went wrong?
When I run the app using yarn android which is pretty much recommended by them, I got this error
info Launching emulator...
error Failed to launch emulator. Reason: Could not start emulator within 30 seconds..
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
What I've tried so far ...?
I have tried to launch it manually but it doesn't connect to the app.
Launch it manually means:
1- yarn start
2- launching the simulator from inside the Android studio

Could not connect to development server - react native error

I had a react native project that is working fine and I switched to another project which is also a react native project. When I came back to the development of the first project I ran the following commands. I use a physical device to debug.
cd ./projectfolder
react-native start --reset-cache
react-native run-android in another terminal
Now the following problems are there, I would like to know what are the causes.
react-native start starts the Metro Bundler but it does not show the
loading progress of the files after react-native run-android
finishes. (Does not serve files)
Still the application starts without any red screen. (How does this
happen if the Metro Bundler has no progress shown?)
Since the application starts I can shake the running device and try
to enable the hot loading but it gives a error on the red screen.
(Sorry for the bad quality, I got this from internet. The same message is there on my physical device.)
I have tried the following methods.
Clear the npm cache using npm cache clean --force.
Make sure that the laptop and the mobile are on the same wifi.
Add android:usesCleartextTraffic="true" to the manifest since there are Android 9 related changes as per most github answers.
Uninstall the application and trying to run again.
Restarting everything.
Ran the bundle command and try but it will not help start the debugger.
Can I have any help on this? Thanks in advance.

React Native opens to white screen in Android simulator

I created a new default project with React Native 0.60.4 and it opens ok in the iOS simulator, but when trying to open it on Android by selecting the project directory and then npm start, react-native run-android it opens to a white screen.
Then shortly after it returns an error message in the android emulator saying:
Unable to load script. Make sure you're either running a Metro server (run 'react-native start') or that your bundle is packaged correctly for release.
The Android simulator is working fine with Flutter so there should be no problem. I looked at other solutions for this issue and they say run react-native start first but I most certainly have done.
First run adb reverse tcp:8081 tcp:8081 on your terminal
You can find it in ~/Library/Android/sdk/platform_tools/
If that's not working please check your host ip and port on developer menu on android.
It can cause the issue on your side.

the development server returned 403 react native

I am doing a react-native based android app following the geeting started tutorials hereusing real android device connected using USB.
When I run react-native run-android it is resulting in error that says development server returned 403 react native
I tried looking it up online but all I could find was that Mcafee blocks the pory 8081, but if that is so how do I change it and make it work.The pictures attached shows what happens when i run"react-native run-android" another picture is here.
Any suggestion would help a lot!Thank you!
This smae question was asked earlier too here
Have you tried to execute react-native start in the same directory where you use react-native run-android?
Try to close all your opened node terminals and:
1) run react-native start
2) wait until node would open the terminal
3) run react-native run-android

Categories

Resources