Skip to content

DevSettingsActivity is not removed in release builds of Android #47223

Description

@SanjayDevTech

Description

I am using Expo managed workflow to build apps. But I do think this issue is not related to expo alone, so putting it here.

On Debug mode we can open the dev settings page by typing "m" in the console. I have seen DevSettingsActivity added to the AndroidManifest on debug app.

But when I build the release apk (by using github actions not eas cloud, but I think both doing the same), I still seeing the DevSettingsActivity added to AndroidManifest.

I saw there is a comment https://github.com/facebook/react-native/blob/dc2000c8750f42b2f01bdad75455750814d567c6/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/AndroidManifest.xml#L5-L8 mentioned like it will be removed in release.

Currently to remove I am using a config plugin

const{ withAndroidManifest }=require("@expo/config-plugins")module.exports=functionandroiManifestPlugin(config){returnwithAndroidManifest(config,asyncconfig=>{constandroidManifest=config.modResults.manifest;constapplication=androidManifest["application"][0];application.activity=application.activity.map(activity=>{if(activity.$["android:name"]!=="com.facebook.react.devsupport.DevSettingsActivity")returnactivity;activity.$["tools:node"]="remove";returnactivity;})returnconfig})}

Steps to reproduce

  1. Create any React Native App
  2. Build it in Release mode
  3. Analyse the APK using any APK analyser app found in playstore.

React Native Version

0.74.6

Output of npx react-native info

System:
OS: Windows 11 10.0.22631
CPU: "(8) x64 AMD Ryzen 7 3700U with Radeon Vega Mobile Gfx "
Memory: 2.76 GB / 13.95 GB
Binaries:
Node:
version: 20.18.0
path: C:\Program Files\nodejs\node.EXE
Yarn:
version: 1.22.22
path: C:\Program Files\nodejs\yarn.CMD
npm:
version: 10.8.2
path: C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK:
API Levels:
- "34"
- "35"
Build Tools:
- 30.0.3
- 33.0.1
- 34.0.0
- 35.0.0
Android NDK: Not Found
Windows SDK:
AllowDevelopmentWithoutDevLicense: Enabled
IDEs:
Android Studio: AI-242.21829.142.2421.12409432
Visual Studio: Not Found
Languages:
Java:
version: 21.0.3
path: C:\Program Files\Android\Android Studio\jbr\bin\javac.EXE
Ruby: Not Found
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.74.5
wanted: 0.74.5
react-native-windows: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: true
iOS:
hermesEnabled: Not found
newArchEnabled: Not found

Screenshots and Videos

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions