-
Notifications
You must be signed in to change notification settings - Fork 24.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
App restarts / crashes when enabling remote debugging with RN 0.73.9 for Android #45399
Comments
Get the following log on the metro bundler: Error: Unable to resolve module ./debugger-ui/debuggerWorker.aca173c4 from /Users/sushantsardeshpande/WebstormProjects/androidRemoteDebugging/ReproducerApp/.: None of these files exist:
|
FYI Remote JavaScript Debugging is deprecated, as you can see from: https://reactnative.dev/docs/other-debugging-methods#remote-javascript-debugging-deprecated cc @huntie |
Yup, we do plan to move to Hermes and use either the Hermes or Experimental debugger. |
Was doing some debugging, and realized that when it tried to reload it was always creating a new thread. PREFS_REMOTE_JS_DEBUG_KEY had been set but not used. Added a condition over it to read for the preference before starting another thread. |
Summary: Added a check in setRemoteJSDebugEnabled in DevSupportManagerBase.java to check for PREFS_REMOTE_JS_DEBUG_KEY to see if the value has changed. Fix for #45399 - App restarting when `NativeDevSettings.setIsDebuggingRemotely` is used in a landing component. If this was invoked from a component load or action that would fire on app start, it was creating an infinite loop where the app would keep on restart before eventually leading to a crash. ## Changelog: [ANDROID] [FIXED] - Fix issue with `NativeDevSettings.setIsDebuggingRemotely` where the app would keep on restarting if remote debugging was invoked from an action / component that was called on app start. Pull Request resolved: #45775 Test Plan: Create a new project using RN CLI. Set `newArchEnabled=false`.� Install modules using `yarn install`.� Build from source for Android by setting the following in `settings.gradle`-� ``` includeBuild('../node_modules/react-native') { dependencySubstitution { substitute(module("com.facebook.react:react-android")).using(project(":packages:react-native:ReactAndroid")) substitute(module("com.facebook.react:react-native")).using(project(":packages:react-native:ReactAndroid")) substitute(module("com.facebook.react:hermes-android")).using(project(":packages:react-native:ReactAndroid:hermes-engine")) substitute(module("com.facebook.react:hermes-engine")).using(project(":packages:react-native:ReactAndroid:hermes-engine")) } } ``` Set the ANDROID_HOME and ANDROID_NDK_HOME environment variables required for react native.�Call `NativeDevSettings.setIsDebuggingRemotely` from App.tsx which is the landing component.� Test with both `hermesEnabled=true` and `hermesEnabled=false` and ensure that app does not keep on restarting after fix. Reviewed By: cipolleschi Differential Revision: D60377406 Pulled By: huntie fbshipit-source-id: c8faf184b50b67f50f8a4b6851df9d0ef3350949
@cortinico Also, you guys have said "We will leave Remote JS Debugging deprecated, but not remove it until we have an full alternative ready for the community." Half of the appeal of our ecosystem are tools like the classic redux-devtools. That one tool alone has probably influenced billions of dollars of IT decisions. We had access to it, we updated, and now we don't. It's frustrating. CC @huntie |
I agree that debugging is crucial for React Native developer experience. @huntie can share more about what is the right alternative here. |
@jehillert Thanks for raising your concerns.
Closing as we previously merged #45775. |
@huntie, |
And to be even less ambitious, I'm just interested in classic redux devtools, and the maybe reviving the ability to listen for network calls. I think having those two things back would make most of us very happy. The rest of what we want is already covered by react devtools and the experimental debugger |
The problem with remote debugging is it's not just deprecated. It's broken. It's been broken for at least a year. And not just once, it seems at least twice now. Three times, if you include incompatibility with react-native-reanimated (so three times). How can I convince my team to accept a patch if it's just going to break again 3 months down the road? |
@huntie At the second place, nobody knew it existed (young crew). Or the experimental debugger. They have just been console logging everything out. What I'm trying to say is it may seem like you left us with enough to hold us over until the new experience is done. But I would bet the practical result is that most of the community no longer has access to redux devtools or network calls. Or any idea how to get them back. And a smaller but significant portion of the community isn't using anything to debug. Just console.logs. it's a much bigger problem than you guys are aware of, imho. |
Description
When enabling remote debugging using NativeDevSettings.setIsDebuggingRemotely(true) on Android the app keeps on restarting and eventually crashes.
Steps to reproduce
React Native Version
0.73.9
Affected Platforms
Runtime - Android
Output of
npx react-native info
Stacktrace or Logs
Reproducer
https://github.com/Sushant-Sardeshpande/androidRemoteDebugging/tree/main
Screenshots and Videos
No response
The text was updated successfully, but these errors were encountered: