Skip to content

Fix debugOptimized DevSettingsActivity manifest#57406

Closed
Phecda wants to merge 1 commit into
react:mainfrom
Phecda:phecda/debug-optimized-dev-settings-activity
Closed

Fix debugOptimized DevSettingsActivity manifest#57406
Phecda wants to merge 1 commit into
react:mainfrom
Phecda:phecda/debug-optimized-dev-settings-activity

Conversation

@Phecda

@Phecda Phecda commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary:

Fixes #57396.

debugOptimized builds still expose the React Native Dev Menu Settings item, but DevSettingsActivity was only declared in the debug manifest. This caused Settings to crash in debugOptimized with ActivityNotFoundException.

This adds a debugOptimized manifest matching the existing debug dev-support manifest, so DevSettingsActivity is declared for that build type.

Changelog:

[ANDROID] [FIXED] - Fix Dev Menu Settings crash in debugOptimized builds

Test Plan:

Verified with RNTester debugOptimized:

yarn install --frozen-lockfile
yarn start
./gradlew :packages:rn-tester:android:app:installDebugOptimized -PreactNativeArchitectures=arm64-v8a

then shake and tap Settings, confirm that Debug Settings opens instead of crashing.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 2, 2026
@Phecda

Phecda commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

Additional context: this crash is more noticeable in debugOptimized because Settings is currently the only Dev Menu path that persists the Metro host through debug_http_host.

Change Bundle Location updates the current PackagerConnectionSettings.debugServerHost, but that setter only updates the in-process cached host. It does not write the new value to SharedPreferences, so the change is lost after killing and restarting the app.

This PR only fixes the Settings crash by making DevSettingsActivity available for debugOptimized.

@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Jul 2, 2026
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment explaining why this manifest is needed and that it hsould be kept in sync with the devsupport one?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, I added a comment. I kept this manifest aligned with the debug DevSupport manifest because debugOptimized still enables DevSupport/Dev Menu while using optimized native code, so debug-only DevSupport entries such as DevSettingsActivity and the legacy FPS overlay permission should remain available.

debugOptimized keeps JS debugging and DevSupport enabled while using optimized native code, but it did not include the debug DevSupport manifest entries.

This caused the Dev Menu Settings action to crash because DevSettingsActivity was not declared for debugOptimized builds. Keeping the debugOptimized manifest in sync with the debug DevSupport manifest also preserves other debug-only DevSupport entries such as the legacy FPS overlay permission.
@Phecda Phecda force-pushed the phecda/debug-optimized-dev-settings-activity branch from 1d19fdf to 2ac576c Compare July 2, 2026 10:37
@Phecda Phecda requested a review from cortinico July 2, 2026 11:04
@meta-codesync

meta-codesync Bot commented Jul 2, 2026

Copy link
Copy Markdown

@cortinico has imported this pull request. If you are a Meta employee, you can view this in D110463462.

@meta-codesync meta-codesync Bot closed this in 2fb4f13 Jul 2, 2026
@meta-codesync meta-codesync Bot added the Merged This PR has been merged. label Jul 2, 2026
@meta-codesync

meta-codesync Bot commented Jul 2, 2026

Copy link
Copy Markdown

@cortinico merged this pull request in 2fb4f13.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dev Menu - Settings will crash the app on debugOptimized build type

2 participants