react native not run in debug mode - react-native

I have a redmi note 3 device
When I connect device via usb and run react-native run-android this is what i've got
No red screen error
If I close the app , then run the packager and open it again I have the app works but debug menu not works by shaking or pressing menu button
What is going wrong here?

Related

React Native App Crashing when opening React Native Developer Tools

I have Custom Development Client App build with EAS and it is always crashing when I try to open React Native Debbuger without any log.
Steps to reproduce:
eas build --profile development --platform android
Start Emulator and download build from link produced in step 1. Open the App.
expo start --dev-client
Press a │ open Android
Press m │ toggle menu
Press "Debug Remote JS" on device/emulator
React Native Debugger opens in th browser but app is crashing and does it everytime I try to open it again.
Same thing happens on the physical device.
React Native application might be using a library that uses JSI, e.g React Native Reanimated 2 (https://docs.swmansion.com/react-native-reanimated/docs/#known-problems-and-limitations) or React Native MMKV (https://github.com/mrousavy/react-native-mmkv#limitations).
With these libraries, remote debugging won't execute properly. I'd start on checking of known limitations on your project's 3rd party libs.
I noticed that connecting expo-dev-client via localhost automatically crashes the app.
Try to use LAN network and make sure that your device and computer are on the same network.

How to enable auto-reloading in expo?

Ive been trying to make a simple app in react native using expo, till yesterday when i saved my app.js file it automatically refreshed the app running on my phone but today i tried running the app it doesnt reload when i save the file after making changes and im also getting this new window till yesterday all was working fine i dont know what happened today. when i click reload on the reload button it reloads but it was much easier when it was automatically refreshing everytime i save.
Looks like you have enabled Debug mode and disabled Fast Refresh. Open the developer menu: https://docs.expo.io/workflow/debugging/#developer-menu
iOS Device: Shake the device a little bit, or touch 3 fingers to the
screen.
iOS Simulator: Hit Ctrl-Cmd-Z on a Mac in the emulator to simulate the
shake gesture, or press Cmd+D.
Android Device: Shake the device vertically a little bit, or run adb
shell input keyevent 82 in your terminal window if your device is
connected via USB.
Android Emulator: Either hit Cmd+M, or run adb shell input keyevent 82
in your terminal window.
Then Enable Fast Refresh.
You might want to also disable Debug Mode by selecting Stop Remote Debugging (this will improve performance and get rid of that localhost window you posted)

The change on the code not reflected with React Native

I am developing a simple chat program with react native for learning purpose (not use expo). I made changes with the chat message (along with other code change) and was trying to reload the new message with USB debugging on Android device. But the app persistently shows the old message before change. Here is what I did:
Under android subdir, run .\gradlew clean
close android studio and react-native run-android again
Shake the device and choose reload
The #3 causes the error below:
Is there some module like nodemon for nodejs which picks up the code change nice and easily?
I often get this issue too. In this situation, I turn off the debug mode, and run adb reverse tcp:8081 tcp:8081 && react-native run-android again.
Connect your phone to your wifi, and try this,
Trigger the Developer Menu
Go to Dev Settings > Debug server host & port for device
Set it to <your_pc_ip_address_on_local_wifi>:8081. (If you are on a emulator, set it to localhost:8081)
Restart the app

react-native run-ios crashes after "bundle" phase of metro bundler

I'm new to RN and trying to debug why the app crashes with no error message. The splash screen comes up, then the green bar on top, then it crashes. There's no message in the metro terminal. The app runs fine if i run it directly from xcode.
Are there some error logs somewhere else?

Android react native app displays white screen unless Chrome debug

My Android app on my Android emulator displays a white screen whenever it boots up, unless I press debug in Chrome, then my app runs fine. Is this normal behaviour? I'm running on a Mac.