Skip to content

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

Description

@Phecda

Description

On Android debugOptimized builds, tapping Settings in the React Native Dev Menu crashes the app.

DevSupportManagerBase adds a Settings menu item that launches DevSettingsActivity. However, DevSettingsActivity is declared only in ReactAndroid/src/debug/AndroidManifest.xml.

The debugOptimized build type is created from debug, but it uses matchingFallbacks += ["release"]. As a result, the debug-only manifest entry for DevSettingsActivity is not available for debugOptimized, while the Dev Menu still exposes the Settings item.

There are two practical problems here:

  1. The Dev Menu should not expose an item that crashes the app. Tapping Settings should either work in debugOptimized, or the item should be hidden/guarded when DevSettingsActivity is not available.
  2. Change Bundle Location should persist the changed packager host. debugOptimized is still a debuggable Metro-based variant, and currently this menu item only changes the host for the current process. After killing and restarting the app, the host falls back to the previous debug_http_host value or the default host. The behavior should be consistent with Debug Settings > Debug server host & port for device, which writes debug_http_host to SharedPreferences.

The key expectation is: debugOptimized should provide a non-crashing and persistent way to configure the Metro/bundler host.

Steps to reproduce

npx @react-native-community/cli init DebugOptimizedSettingsRepro --version 0.86.0
cd DebugOptimizedSettingsRepro
yarn start

Then

  1. Build and install the debugOptimized variant.
  2. Shake to open the React Native Dev Menu.
  3. Tap Settings.

React Native Version

0.84.1

Output of npx @react-native-community/cli info

info Fetching system and libraries information...
System:
  OS: macOS 26.5.1
  CPU: (10) arm64 Apple M4
  Memory: 233.69 MB / 24.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 22.22.2
    path: ~/.nvm/versions/node/v22.22.2/bin/node
  Yarn:
    version: 4.14.1
    path: ~/.nvm/versions/node/v22.22.2/bin/yarn
  npm:
    version: 10.9.7
    path: ~/.nvm/versions/node/v22.22.2/bin/npm
  Watchman:
    version: 2026.06.22.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods: Not Found
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 25.5
      - iOS 26.5
      - macOS 26.5
      - tvOS 26.5
      - visionOS 26.5
      - watchOS 26.5
  Android SDK: Not Found
IDEs:
  Android Studio: 2026.1 AI-261.23567.138.2611.15503007
  Xcode:
    version: 26.6/17F113
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.19
    path: /usr/bin/javac
  Ruby:
    version: 2.7.8
    path: /Users/jerry/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 20.1.0
    wanted: 20.1.0
  react:
    installed: 19.2.3
    wanted: 19.2.3
  react-native:
    installed: 0.84.1
    wanted: patch:react-native@npm%3A0.84.1#~/.yarn/patches/react-native-npm-0.84.1-edb3124e38.patch
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true

info React Native v0.86.0 is now available (your project is running on v0.84.1).
info Changelog: https://github.com/facebook/react-native/releases/tag/v0.86.0
info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.84.1&to=0.86.0
info For more info, check out "https://reactnative.dev/docs/upgrading?os=macos".

Screenshots and Videos

Screenrecorder-2026-07-02-11-01-54-397.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    API: SettingsDebuggingIssues related to React Native DevTools or legacy JavaScript/Hermes debuggingNeeds: Author FeedbackNeeds: ReproThis issue could be improved with a clear list of steps to reproduce the issue.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions