Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53718
I've just realized we ended up invoking `project.` inside the execution of `BundleHermesCTask`.
This is an anti-pattern and is breaking Gradle Configuration caching.
Instead we should be checking if hermesV1Enabled is set during the Task registration and pass over this information
to the task.
Changelog:
[Internal] [Changed] -
Reviewed By: j-piasecki
Differential Revision: D82130643
fbshipit-source-id: d2026711666867b3767824381cc5be0af3b476cc
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53725
Changelog: [GENERAL][CHANGED] - Changed the coordinates of hermes artifacts when using Hermes V1
Adds a new `version.properties` file to keep which hermes versions should be consumed from Maven once the versions of Hermes and React Native are decoupled. This diff only implements changes necessary for consuming Hermes V1, as we don't want to migrate everything quite yet (0.82).
Reviewed By: cortinico
Differential Revision: D82204203
fbshipit-source-id: d712257a73f7ba54612a55c1b312416376f28b56
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53665
Changelog: [ANDROID][FIXED] - Read the Hermes V1 opt-in flag from the apps properties when building from source
Reviewed By: cortinico
Differential Revision: D82018545
fbshipit-source-id: f3c6fdbac190f47b6bf6836105d9e0909d8b86ba
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53281
This is still a of bumping Gradle to the latest Major (9.0)
Full list of changes is here: https://gradle.org/whats-new/gradle-9/
I don't expect any breaking changes for React Native users.
Changelog:
[Android] [Breaking] - **deps:** Gradle to 9.0
Reviewed By: cipolleschi
Differential Revision: D79445941
fbshipit-source-id: 0af495a2cc6bb4cca1e37d5f0693b77e42010df2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53138
Without this patch, library could break if the user removes the `newArchEnabled=`
property from the `gradle.properties` file.
With this patch instead we hardcode the property to true, so all the libraries can consume
it if they wish.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D79805857
fbshipit-source-id: 88dda707a0d80ac79e96c955ded2ef0823f3d3ff
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53025
It's now time to say goodbye to the Legacy Architecture :')
This change hardcodes the `newArchEnabled` property to true, and warns the users
if they're attempting to set it to false.
Changelog:
[Android] [Breaking] - Remove possibility to newArchEnabled=false in 0.82
Reviewed By: cipolleschi
Differential Revision: D78560296
fbshipit-source-id: ccfc45d2f7f21cc20e063cb901d76be3d41458d6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52803
I've just realized that our build suffer from a race condition. Specifically
libraries codegen needs to be executed before the app starts the evaluating CMake files.
Otherwise this could lead to a lot of missing files or folders.
Changelog:
[Android] [Fixed] - **rngp:** Fix a race condition with codegen libraries missing sources
Reviewed By: huntie
Differential Revision: D78886347
fbshipit-source-id: f59c201d2eab651bc4a08cf5a795acd379d18186
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52648
This creates a `debugOptimized` build type for React Native Android, meaning that we can run C++ optimization on the debug build, while still having the debugger enabled. This is aimed at improving the developer experience for folks developing on low-end devices or emulators.
Users that intend to debug can still use the `debug` variant where the full debug symbols are shipped.
Changelog:
[ANDROID] [ADDED] - Create a debugOptimized buildType for Android
Reviewed By: cipolleschi
Differential Revision: D78425138
fbshipit-source-id: c1e9ea3608e7df10fb871a5584352f0747cf560b
Summary:
This creates a `debugOptimized` build type for React Native Android, meaning that we can run C++ optimization on the debug build, while still having the debugger enabled. This is aimed at improving the developer experience for folks developing on low-end devices or emulators.
Users that intend to debug can still use the `debug` variant where the full debug symbols are shipped.
## Changelog:
[ANDROID] [ADDED] - Create a debugOptimized buildType for Android
Pull Request resolved: https://github.com/facebook/react-native/pull/52620
Test Plan:
Tested locally with RNTester by doing:
```
./gradlew installDebugOptimized
```
This is the output of the 3 generated .aar. The size difference is a proof that we're correctly stripping out the C++ debug symbols:
<img width="193" height="54" alt="Screenshot 2025-07-15 at 17 49 50" src="https://github.com/user-attachments/assets/584a0e8d-2d17-40d4-ac29-da09049d6554" />
<img width="235" height="51" alt="Screenshot 2025-07-15 at 17 49 39" src="https://github.com/user-attachments/assets/eda8f9e7-3509-4334-8c16-990e55caa04d" />
<img width="184" height="52" alt="Screenshot 2025-07-15 at 17 49 32" src="https://github.com/user-attachments/assets/a5c94385-bc00-4484-b43e-088ee039827f" />
Rollback Plan:
Reviewed By: cipolleschi
Differential Revision: D78351347
Pulled By: cortinico
fbshipit-source-id: 568a484ba8d2ee6e089cabc95451938e853fbc54
Summary:
This PR adds the basic `ktfmt` setup in OSS to lint Kotlin files before they're imported into the Meta codebase, making collaboration with external contributors smoother for Android related PRs.
I tried to put together certain rules that mimic the current code style and it seems to work well as I get no errors for properly formatted files but this still might need some input to have the correct configuration.
Added two scripts to the main package.json:
- To check the files format you can run: `yarn lint-kotlin-check`
- To apply formatting fixes, run: `yarn lint-kotlin`
## Changelog:
[INTERNAL] - Kotlin: Set up ktfmt in OSS
Pull Request resolved: https://github.com/facebook/react-native/pull/52064
Test Plan:
Unformat any random Kotlin file inside ReactAndroid and then run:
```sh
yarn lint-kotlin-check
yarn lint-kotlin
```
Reviewed By: cipolleschi
Differential Revision: D78272876
Pulled By: cortinico
fbshipit-source-id: 0cf6b976968dfc5c6c478e88d17eb21c18961a34
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52399
I'm raising the deprecation warnings for those methods that are using legacy arch.
Previously the `DeprecatedInNewArchitecture` was not generating warnings for user in their builds, while now the Kotlin's/Java's `DeprecatedInNewArchitecture` it will.
Changelog:
[Android] [Changed] - Introduce more deprecation warnings for Legacy Arch classes
Reviewed By: mdvacca
Differential Revision: D77736713
fbshipit-source-id: bc21729ed8253d3ec6b6a40577bcd76622c3f8a6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52378
This adds a Gradle property called `exclusiveEnterpriseRepository`
that users can set in their `android/gradle.properties` as such:
```diff
# Use this property to enable or disable the Hermes JS engine.
# If set to false, you will be using JSC instead.
hermesEnabled=true
+exclusiveEnterpriseRepository=https://my.internal.proxy.net/
```
This will remove all the existing Maven repositories and only use the internal mirror they have.
Changelog:
[Android] [Added] - RNGP - Add support for `exclusiveEnterpriseRepository` to specify an internal Maven mirror.
Reviewed By: mdvacca
Differential Revision: D77667573
fbshipit-source-id: 835004d2ae7aa4e250b6f7a88a41918b573f5bd5
Summary:
This follows https://github.com/facebook/react-native/pull/47554
Compared to the initial proposal, I had to remove the `edgeToEdgeEnabled` property from the root `gradle.properties` and put it in the app `gradle.properties` instead (explaining the `AgpConfiguratorUtils.kt` / `GenerateEntryPointTask.kt` / `ProjectUtils.kt` / `PropertyUtils.kt` changes)
This PR:
- Enable edge-to-edge for `MainActivity` (when `edgeToEdgeEnabled` is set to `true`)
- Disable `StatusBar` `backgroundColor` and `translucent` (when `edgeToEdgeEnabled` is set to `true`)
- Enforce `statusBarTranslucent` and `navigationBarTranslucent` on `Modal` when edge-to-edge is enabled
- Add an `isEdgeToEdge` constant to `DeviceInfoModule` for [`react-native-is-edge-to-edge`](https://github.com/zoontek/react-native-edge-to-edge/tree/main/react-native-is-edge-to-edge) detection
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
- [Android] [Added] - Add edge-to-edge opt-in support
Pull Request resolved: https://github.com/facebook/react-native/pull/52088
Test Plan:
- Update `enableEdgeToEdge` value in `packages/rn-tester/android/app/gradle.properties`
- Recompile
https://github.com/user-attachments/assets/4c6beb98-fa88-427c-b62d-a42ffe5330f0
Rollback Plan:
Reviewed By: cortinico
Differential Revision: D76834213
Pulled By: alanleedev
fbshipit-source-id: c39b2cff1a5e94e31306e3b35651aa2de83d2fe6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52015
Changelog: [Internal]
Add gflags to fantom_tester so we can pass in data like featureFlags
Reviewed By: cortinico
Differential Revision: D76618409
fbshipit-source-id: a18e642a02c405eef972a7418a606a5980253b6a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51949
This code is no longer necessary now that JSC support is offered via
https://github.com/react-native-community/javascriptcore
Instructions for users on how to continue using JSC are available in the README of such library.
Changelog:
[Android] [Removed] - Remove 1st party JSC support
Reviewed By: javache
Differential Revision: D76420382
fbshipit-source-id: f8e61556bb02fe4d5b34f89b40f8e5e38ac1c8d6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52004
This is necessary because the snapshots are now going to be published on a different repository:
central.sonatype.com.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D76596802
fbshipit-source-id: 424fb1134e41502d53b76209fba325c895c79ba8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51854
AGP 8.10.x comes with a source breaking change:
https://issuetracker.google.com/issues/416890061
This shoudl fix it and unblock us for the 0.81 release.
Changelog:
[Android] [Changed] - Bump AGP to 8.10.x
Reviewed By: huntie
Differential Revision: D76053989
fbshipit-source-id: b0fe19544c79d65002127176f2722cdfd85f0a3c
Summary:
Resolved a build error [issue https://github.com/facebook/react-native/issues/51297](https://github.com/facebook/react-native/issues/51297) caused by assigning a Boolean to a Property<Boolean>.
Switched from direct assignment to using .set(...) to correctly configure allWarningsAsErrors from project properties.
## Changelog:
- Gradle fix: assign allWarningsAsErrors using .set() for Property<Boolean>
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - [ANDROID] [FIXED]
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
Pull Request resolved: https://github.com/facebook/react-native/pull/51300
Test Plan:
Fixes build failure with React Native v0.79.2 and Gradle v8.0.
```
npm run start
npm run android
```
no more build errors
Reviewed By: cortinico
Differential Revision: D74706741
Pulled By: rshest
fbshipit-source-id: 31ec923f49a6da63fb5abb464bc38b99b1e8650a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50929
We decided to change the warning model for LegacyArch/NewArch.
I'm currently removing the infra to read the `legacyWarningsEnabled` Gradle property if provided.
Warnings will be enabled by default for all Legacy Arch users in the new model.
This change was never shipped in a numbered version, so that's not breaking.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D73591315
fbshipit-source-id: a46fade91b46fcc9b81984577161c046dc0939b6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50780
This bumps Kotlin to the latest stable: 2.1.20.
I've also fixed several warnings emitted by the new compiler.
Changelog:
[Android] [Changed] - Kotlin to 2.1.20
Reviewed By: rshest
Differential Revision: D73122000
fbshipit-source-id: 019a01d085b2c115a3efcf567056e9990a1ff0ce
Summary:
I've implemented a feature that automatically bundles the Metro Bundler's IP address into Android builds. This change aligns the Android development experience with iOS, allowing the app to maintain a connection to the Metro Bundler even when disconnected from USB.
Currently, in iOS builds, the IP address of the computer running the Metro Bundler is automatically bundled into the app, ensuring seamless connectivity even when the device is disconnected from USB. In contrast, Android developers must manually input the IP address if the USB connection is lost, which can be tedious and error-prone.
More info in discussion thread: https://github.com/react-native-community/discussions-and-proposals/issues/870
I anticipate that a change where making IP the default method of connection will result in a lot of people running into issues where they can't connect to Metro server (for example, if they're on a different network, or they disable wifi). So I also changed the default error message you get in case the app can't connect to the bundler and updated the "Change Bundle Location" dev menu.
The previous error message
```
Unable to load script. Make sure you're either
running Metro (run 'npx react-native start') or
that your bundle 'RNTesterApp.android.bundle' is
packaged correctly for release.
```
was changed to:
```
Unable to load script.
Make sure you're running Metro (npx react-native start)
or that your bundle 'RNTesterApp.android.bundle' is
packaged correctly for release.
The device must be on the same WiFi as your laptop to
connect to Metro.
To use USB instead, shake the device to open the dev
menu and set the bundler location to 'localhost: 8081'
and run:
adb reverse tcp:8081 tcp:8081
```

And the new dev menu UI looks like this:

The two buttons with "10.0.2.2:8081" and "localhost:8081" are suggestions which when tapped fill the input with the text from the button. The first button suggests the IP of the development machine, and the second one is hardcoded to localhost:8081.
## Changelog:
[ANDROID] [CHANGED] - Automatically use Metro bundler IP address when installing apps on Android
Pull Request resolved: https://github.com/facebook/react-native/pull/49166
Test Plan:
I've tested the implementation on a physical device and on emulator and it's working solid. However, I would invite further testing in order to catch possible edge cases.
I've recorded common scenarios
Scenario 1:
Device doesn't have the app installed.
We connect the device via USB, install the app and open it.
Device is on the same network as the dev machine.
Bundler location is by default set to the IP of the dev machine.
When starting app, the app is able to connect to the dev machine and download the bundle.
Scenario 2:
Device doesn't have the app installed.
Wi-Fi is turned off on the device but device is connected via USB
We install the app and open it.
Bundler location is by default set to the IP of the dev machine.
When starting app, the app is not able to connect to the dev machine and shows the error message.
After opening the dev menu we see that the IP is set to the IP of the dev machine.
We click the "localhost" option in the dev menu and click apply
After that the app is able to connect to the dev machine and download the bundle (via USB) since the traffic is forwarded using adb reverse.
Notes:
When we set an IP in the dev menu, the app will persist it.
If we connect the device via USB and reinstall the app the persisted data stays the same, so the previously set IP will be used.
However, the IP of the dev machine will be displayed as an option in the dev menu.
https://github.com/user-attachments/assets/cc2da5d4-de07-4980-a61c-68ca53db74c7https://github.com/user-attachments/assets/407b8871-8b83-4a6b-a833-f87ddc0afc82
Reviewed By: huntie
Differential Revision: D69664231
Pulled By: cortinico
fbshipit-source-id: 5a339be50a17a59202416b99e72f4397d8ff4805
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50470
This diff introduces a new property called `legacyWarningsEnabled` for `gradle.properties` that
toggles the Legacy Arch warnings for users.
I've also introduced a new `ReactNativeApplicationEntryPoint` that is generated by RNGP. This class
effectively wrap `DefaultNewArchitectureEntryPoint` by setting warnings and also invoking SoLoader.
It will reduce the errors in the user space.
As of now warnigns appear in Logcat, but I'm looking into adding some UI in a subsequent diff.
Changelog:
[Android] [Added] - Add a `legacyWarningsEnabled` property to enable Legacy Warnings on NewArch
Reviewed By: mdvacca
Differential Revision: D72383907
fbshipit-source-id: bcd659a23ec5b468958124f0f6650ff72d01ce81
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50172
This specific warning is only for React Native users.
We don't need this warning on console for RNtester so I'm excluding react-native-github
project from the list of project where this warning gets fired.
Changelog:
[Internal] [Changed] - Do not warn for JSC deprecation on react-native-github
Reviewed By: mdvacca
Differential Revision: D71556035
fbshipit-source-id: 8ab625eb2c090416119903dbc9c29afac51c91bd
Summary:
Okay the title is a bit clickbaity, but this is actually true. (on Android)
We (Janic, Szymon, Ruby and Me) discovered something interesting. React Native uses `mmap` for mapping the JS bundle to RAM, to avoid having to load the entire thing instantly at app startup.
Ruby doubted that this was true - so we investigated.
Apparently on Android, resources are **compressed**. And if the JS bundle is stored compressed, it has to be uncompressed before it can be loaded into RAM, hence not allowing it to be mmapp'ed! (see [`_CompressedAsset::getBuffer`](https://cs.android.com/android/platform/superproject/+/master:frameworks/base/libs/androidfw/Asset.cpp;l=903?q=Asset.cpp))
So with this PR, we now add `.bundle` files to `noCompress` in the react-native gradle plugin, which disables compression for the JS bundle.
We discovered while improving the performance of one of our clients: **Discord**.
In our tests, **this improved the TTI of the Discord app by 400ms!! (or 12%)** 🤯🚀
NOTE: Yes, the .apk will now be bigger. But; Google Play compresses it anyways, so the **download size** of your .apk will likely not increase by much. It will be bigger on disk though.
## Changelog:
[ANDROID] [CHANGED] Add option to disable bundle compression to improve startup time
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
Pull Request resolved: https://github.com/facebook/react-native/pull/49449
Test Plan:
### 1. Verify compression is disabled
Build two apps, one with this patch and one without. When I did this using the RN community template, the one without this patch was 47,6 MB, and the one with this patch was 48 MB in size. So the .apk got bigger, which is what we expected
### 2. Verify app startup is faster
Use tools like react-native-performance or custom markers to measure TTI. In our tests, we shaved off 400ms from the startup time, which was about 12% of Discord's total TTI. (on a low-end Android device)
In Expensify, we improved the TTI by 14-20% with this change (source: https://github.com/Expensify/App/pull/56930)
Reviewed By: javache, cipolleschi
Differential Revision: D69742221
Pulled By: cortinico
fbshipit-source-id: bd59d77662bd30a3acdbb2e9f8d8f23db922c3f2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49426
This is a nit, but I'm following up on a review comment that was left behind.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D69656370
fbshipit-source-id: 76de4d77d9993bd9a35d7df019a6cebcce13d632
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49439
This is the next part of a series of diff needed to enable G. Configuration Cache:
https://docs.gradle.org/current/userguide/configuration_cache.html
as it will make our CI faster (and will be the default in the future Gradle version).
Here I'm removing the `onlyIf` lambdas to make some tasks CC friendly.
The problem is that some `onlyIf` lambdas can't easily be serialized. Here I'm cleaning up
the problematic one to move the condition checks at execution time
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D69664732
fbshipit-source-id: a457b2fae8114568ec4e04d772c9944022b1e1a5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49438
This is the second part of a series of diff needed to enable G. Configuration Cache:
https://docs.gradle.org/current/userguide/configuration_cache.html
as it will make our CI faster (and will be the default in the future Gradle version).
Here I'm making the exec tasks CC friendly.
The problem is that previously we were using explicit streams which are not CC friendly
for stderr/stdout. The solution is to create a custom task and handle files as input
properties.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D69662246
fbshipit-source-id: ad7e82e52b12d508ee15b68408882fdc3516d287
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49400
We should not invoke anything on the `project` property inside thet task.
That will break Gradle Configuration Caching which is becoming the default in the next version of Gradle.
This fixes it for the `GenerateCodegenArtifactsTask` task.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D69592464
fbshipit-source-id: 72bab3f29299313875f2e7abd1b701c9d74bd2a1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49399
We should not invoke anything on the `project` property inside thet task.
That will break Gradle Configuration Caching which is becoming the default in the next version of Gradle.
This fixes it for the `GenerateCodegenSchemaTask` task.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D69592463
fbshipit-source-id: 56e78b1bdc113ae402cc90960faa05cd73d5b97d