Environment
"react-native": "0.63.4"
node --version: v15.8.0
When I try to run application on two phones (Android via USB and iOS emulator) by running following command:
npx react-native run-android && npx react-native run-ios
my application launches correctly but on running it shows me infinite reloading. (what I mean by infinite is that message 'Refreshing' shows up then disappears and so on in infinite loop.
And after a dozen of reloading it ends up with an error.
Here are the errors.
Thank you in advance!
I had the same issue and managed to solve it by placing the project folder inside a "tmp" called folder.
Related
I've created the simple intitialised app via:
react-native init myApp
It creates it fine. And when I run it with:
react-native run-android
I get the following error:
Error: Unable to resolve module `./Libraries/YellowBox/YellowBox` from `node_modules\react-native\index.js`:
None of these files exist:
* node_modules\react-native\Libraries\YellowBox\YellowBox(.native|.android.js|.native.js|.js|.and....(continues)
The incredibly frustrating thing about this is that I've successfully run the initialised app (on previous initialisations) multiple times in the last few days. So I don't know why it won't run today (tried three initialisations today). I haven't changed the code one character from the intitialisation. I've tried restarting my computer, deleting my virtual android device (via Android Studio) and creating a new one. Still the same error keeps coming up. I've tried running it via my physical Android device, same error. I've tried deleting the node-modules from the project and reinstalling them (npm install). Same error. Any ideas?
I managed to solve it using this command:
react-native start --reset-cache
After start of the Metro run the app:
react-native run-android
In my case it happened after updating a package.
Ran into this same issue, found it to be a caching issue with metro.
YellowBox was moved to YellowBoxDeprecated.
I was able to fix this issue by doing the following:
delete node_modules and package-lock.json
clear metro-cache folder.(for windows default location is %appdata%\Local\Temp\metro-cache)
clear gradle cache (cd android & .\gradlew clean)
npm install the packages
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.
I am trying to run react-native run-android but in 1st project, it is working perfectly, but in other it automatically stops after starting intent. I have also tried adb reverse tcp:8081 tcp:8081 but its not working for my project named, "basicredux" I have attached the screenshot , hope it will help you to help me to solve this problem.
I have also tried the solution in
'React native run android' stop immediatelly after start the app in emulator
But it is not working.
in my first project which i created about 1 month ago, it is working perfectly, but not with any of my new projects.
Sorry for not disclosing my first project name.
Working perfectly on my this 1 month old project :
Not working on this project or any new Projects:
Attaching the Log Cat :
I found that after running react-native start along with react-native run-android in same project directory, the 'react-native run-android' stops but on editing the App.js file I can see the changes, only by clicking the reload button from the emulator screen or, ctrl + M then reload
Solution
Run react-native start in one terminal
then react-native run-android in another tab of the terminal
then ctrl + M then reload in emulator devices, or shake and reload in real devices.
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
is there any way or framework to Running On Device from android studio to run option to launch the app. (instead of react-native run-android command)
I don't see any stuff like that from React-Native Docs.
Update: i got some info after my research. i am seeing there is a possibility to create/modify a gradle task which can run the yarn commands to launch my app. will keep posted.
I had the same problem.
Solution
Open your project in Android Studio
Start react native packager by typing react-native start (it will pop-out a terminal for js-bundling)
In android studio "Run" your App. (In case you want to use break-points "Debug-Run" your App.)
You are Done.
Just open the project on android studio and hit the play button, it should work.