Fix for app restart on Android in case of remote debugging#45775
Closed
Sushant-Sardeshpande wants to merge 1 commit into
Closed
Fix for app restart on Android in case of remote debugging#45775Sushant-Sardeshpande wants to merge 1 commit into
Sushant-Sardeshpande wants to merge 1 commit into
Conversation
Added a check in setRemoteJSDebugEnabled in DevSupportManagerBase.java to check for PREFS_REMOTE_JS_DEBUG_KEY to see if the value has changed.
Collaborator
|
huntie
approved these changes
Jul 29, 2024
Member
|
Thanks for this fix! |
Contributor
|
@huntie has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Contributor
Collaborator
|
This pull request was successfully merged by @Sushant-Sardeshpande in beebf4a When will my fix make it into a release? | How to file a pick request? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added a check in setRemoteJSDebugEnabled in DevSupportManagerBase.java to check for PREFS_REMOTE_JS_DEBUG_KEY to see if the value has changed.
Summary:
Fix for #45399 - App restarting when
NativeDevSettings.setIsDebuggingRemotelyis 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.setIsDebuggingRemotelywhere the app would keep on restarting if remote debugging was invoked from an action / component that was called on app start.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-Set the ANDROID_HOME and ANDROID_NDK_HOME environment variables required for react native. Call
NativeDevSettings.setIsDebuggingRemotelyfrom App.tsx which is the landing component.Test with both
hermesEnabled=trueandhermesEnabled=falseand ensure that app does not keep on restarting after fix.