Summary:
This class doesn't have any FIXMEs to fix, so we can just annotate it and protect against future issues!
Changelog: [Android][Fixed] Mark ReactContextBaseJavaModule.java as nullsafe
Reviewed By: javache
Differential Revision: D72704852
fbshipit-source-id: 65abc94d59aefc64ff214bd70ead16d9011dec20
Summary:
This class doesn't have any FIXMEs to fix, so we can just annotate it and protect against future issues!
Changelog: [Android][Fixed] Mark ReactMarker.java as nullsafe
Reviewed By: javache
Differential Revision: D72704853
fbshipit-source-id: 2d022f407070ab473a43281fab6f28c53fa09f21
Summary:
This class doesn't have any FIXMEs to fix, so we can just annotate it and protect against future issues!
Changelog: [Android][Fixed] Mark NativeModule.java as nullsafe
Reviewed By: javache
Differential Revision: D72704850
fbshipit-source-id: a71f3acddb0382410739b9632fba509fffcfebfd
Summary:
This is not a TextInput and is totally unused (whoops).
Changelog: [Internal]
Reviewed By: cortinico, Abbondanzo
Differential Revision: D72683433
fbshipit-source-id: 1218701fdc473117774a9bdb6f94b6a4508599a4
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:
We only use fbsystrace API's directly from cxxreact and reactperferflogger targets, so export the dependency and the preprocessor flag there so we do not have to duplicate (and potentially forget to do this) from all other targets in react-native.
Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D72704827
fbshipit-source-id: 845c174b4f9ce0a67dd80be3f6274234328bbdb9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50592
For unclear reasons this is crashing on some devices when dereferencing the module ref. Instead we can just access the existing global_ref to the module instance and avoid any deallocation timing issues.
Also added some additional safeguards and validation against incorrect JNI invocations.
Changelog: [Android][Fixed] Fix crash when TurboModule event emitters are used on arm32
Reviewed By: cortinico
Differential Revision: D72716972
fbshipit-source-id: 3803329048d8388b3d30c9cb55a857e399569eea
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50594
Some tests are failing due to unsatisfied error when looking for C++ classes of feature flags, we fix this by calling ReactNativeFeatureFlagsForTests.setup()
changelog: [internal] internal
Reviewed By: yungsters, sbuggay
Differential Revision: D72721786
fbshipit-source-id: c41c05428b1f99db9b03bb67cd9ddc47ebec84b5
Summary:
Gone trough all the FIXMEs added in the previous diff by the nullsafe tool, marked the class as nullsafe and ensured no remaining violations.
Changelog: [Android][Fixed] Made FabricUIManager.java nullsafe
Reviewed By: cortinico
Differential Revision: D72705994
fbshipit-source-id: 56786a5df78322e833401c94dafae4e9335feefe
Summary:
Gone trough all the FIXMEs added in the previous diff by the nullsafe tool, marked the class as nullsafe and ensured no remaining violations.
Changelog: [Android][Fixed] Made TextAttributeProps.java nullsafe
Reviewed By: rshest
Differential Revision: D72460127
fbshipit-source-id: b5b098d8763ed45579c50068033374dfc88afa86
Summary:
Added nullsafe FIXMEs for easier reviewing of next diff, where we fix them
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D72460132
fbshipit-source-id: 4ff177555f4d035be82ec6a134227f9ed2076fb9
Summary:
Gone trough all the FIXMEs added in the previous diff by the nullsafe tool, marked the class as nullsafe and ensured no remaining violations.
Changelog: [Android][Fixed] Made ReactTextViewManager.java nullsafe
Reviewed By: javache
Differential Revision: D72460124
fbshipit-source-id: a75705ac4ab486ccaa9162dee5bfd8cae77967c7
Summary:
Added nullsafe FIXMEs for easier reviewing of next diff, where we fix them
Changelog: [Internal]
Reviewed By: arushikesarwani94
Differential Revision: D72460133
fbshipit-source-id: 7673e962e50946b504e3bd9446b3aef962271241
Summary:
Added nullsafe FIXMEs for easier reviewing of next diff, where we fix them
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D72460130
fbshipit-source-id: fbc073e7b644326e85a05227c1e2e72e3dd5b870
Summary:
Added nullsafe FIXMEs for easier reviewing of next diff, where we fix them
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D72460128
fbshipit-source-id: 5165055b1023a9eab86b97ef6cdfa9553c063ec0
Summary:
https://developer.android.com/reference/android/widget/TextView#setEllipsize(android.text.TextUtils.TruncateAt) explicitly allows setting setEllipsize's argument in TextView to null to turn off ellipsizing, which is what we want for `clip`
Gone trough all the FIXMEs added in the previous diff by the nullsafe tool, marked the class as nullsafe and ensured no remaining violations.
Changelog: [Android][Fixed] Made ReactTextAnchorViewManager.java nullsafe
Reviewed By: alanleedev
Differential Revision: D72460123
fbshipit-source-id: 26d91d273ead5906060772f65a32fbf4389d0db3
Summary:
Added nullsafe FIXMEs for easier reviewing of next diff, where we fix them
Changelog: [Internal]
Reviewed By: alanleedev
Differential Revision: D72460131
fbshipit-source-id: d2b82fe1abcfd828490820f31862339bce9785b6
Summary:
Gone trough all the FIXMEs added in the previous diff by the nullsafe tool, marked the class as nullsafe and ensured no remaining violations.
Changelog: [Android][Fixed] Made ReactBAseTeextShadowNode.java nullsafe
Reviewed By: alanleedev
Differential Revision: D72460122
fbshipit-source-id: 772b19016fa1558b549d73ad2b23f891ce2f57f6
Summary:
Added nullsafe FIXMEs for easier reviewing of next diff, where we fix them
Changelog: [Internal]
Reviewed By: alanleedev
Differential Revision: D72460134
fbshipit-source-id: b5e8864ddd7454ef23c5632dc2c8e502050dfe2b
Summary:
Gone trough all the FIXMEs added in the previous diff by the nullsafe tool, marked the class as nullsafe and ensured no remaining violations.
Changelog: [Android][Fixed] Made ViewManagerRegistry.java nullsafe
Reviewed By: alanleedev
Differential Revision: D72384049
fbshipit-source-id: dbca38ee6379e2e64b37c1d265c001585344661d
Summary:
Added nullsafe FIXMEs for easier reviewing of next diff, where we fix them
Changelog: [Internal]
Reviewed By: alanleedev
Differential Revision: D72384050
fbshipit-source-id: ac88074a45752a5512daa09fce8c385b256b3d41
Summary:
Gone trough all the FIXMEs added in the previous diff by the nullsafe tool, marked the class as nullsafe and ensured no remaining violations.
Changelog: [Android][Fixed] Made TouchTargetHelper.java nullsafe
Reviewed By: rshest
Differential Revision: D72384076
fbshipit-source-id: 344d93484cb465f4841256d302a6d9eec1467643
Summary:
Added nullsafe FIXMEs for easier reviewing of next diff, where we fix them
Changelog: [Internal]
Reviewed By: rshest
Differential Revision: D72384058
fbshipit-source-id: 543da56ed4410625f17d143b127aa5cc882e0327
Summary:
Gone trough all the FIXMEs added in the previous diff by the nullsafe tool, marked the class as nullsafe and ensured no remaining violations.
Changelog: [Android][Fixed] Made ThemedReactContext.java nullsafe
Reviewed By: alanleedev
Differential Revision: D72384053
fbshipit-source-id: 39ce998cfce1de358f13b4f068f180dfd1d88378
Summary:
Added nullsafe FIXMEs for easier reviewing of next diff, where we fix them
Changelog: [Internal]
Reviewed By: alanleedev
Differential Revision: D72384062
fbshipit-source-id: 70b7b4490e002016a83746336b9bb397e917a858
Summary:
Gone trough all the FIXMEs added in the previous diff by the nullsafe tool, marked the class as nullsafe and ensured no remaining violations.
Changelog: [Android][Fixed] Made JSPointerDispatcher.java nullsafe
Reviewed By: alanleedev
Differential Revision: D72384071
fbshipit-source-id: 474671024632f7cdce7547855d0631c6a7005e8b
Summary:
Added nullsafe FIXMEs for easier reviewing of next diff, where we fix them
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D72384057
fbshipit-source-id: fd10242d14dd3e9cc2f6cd72dcac693b0f52c818
Summary:
Gone trough all the FIXMEs added in the previous diff by the nullsafe tool, marked the class as nullsafe and ensured no remaining violations.
Changelog: [Android][Fixed] Made PromiseImpl.java nullsafe
Reviewed By: alanleedev
Differential Revision: D72384070
fbshipit-source-id: 142a0e001af42ebb8cc1c8301b3ec7f586191d92
Summary:
Added nullsafe FIXMEs for easier reviewing of next diff, where we fix them
Changelog: [Internal]
Reviewed By: alanleedev
Differential Revision: D72384080
fbshipit-source-id: f859a21826bd1dd9d6fa0da82df5a4f0e9e79264
Summary:
Gone trough all the FIXMEs added in the previous diff by the nullsafe tool, marked the class as nullsafe and ensured no remaining violations.
Changelog: [Android][Fixed] Made NativeModuleRegistry.java nullsafe
Reviewed By: javache
Differential Revision: D72384075
fbshipit-source-id: bebc637a757c9f86d6260f9076010de9d7c80d4a
Summary:
Added nullsafe FIXMEs for easier reviewing of next diff, where we fix them
Changelog: [Internal]
Reviewed By: alanleedev
Differential Revision: D72384051
fbshipit-source-id: 6cc3ab112a676fe6dfcfa1a4aa74e0dcd0e53e4a
Summary:
Gone trough all the FIXMEs added in the previous diff by the nullsafe tool, marked the class as nullsafe and ensured no remaining violations.
Changelog: [Android][Fixed] Made ModuleHolder.java nullsafe
Reviewed By: alanleedev
Differential Revision: D72384056
fbshipit-source-id: 42bfdd9b73bdb599ab67b6fe8759c80665156d22
Summary:
Added nullsafe FIXMEs for easier reviewing of next diff, where we fix them
Changelog: [Internal]
Reviewed By: alanleedev
Differential Revision: D72384081
fbshipit-source-id: a45f551089f9484d11d0701c98a06467da667b36
Summary:
Gone trough all the FIXMEs added in the previous diff by the nullsafe tool, marked the class as nullsafe and ensured no remaining violations.
Changelog: [Android][Fixed] Made JsonWriterHelper.java nullsafe
Reviewed By: alanleedev
Differential Revision: D72384060
fbshipit-source-id: ce41674cc5dbadcd70029396607ac046100e2be7
Summary:
Added nullsafe FIXMEs for easier reviewing of next diff, where we fix them
Changelog: [Internal]
Reviewed By: alanleedev
Differential Revision: D72384061
fbshipit-source-id: 7a238fae907398ad785b169db7232068eef5617b
Summary:
Gone trough all the FIXMEs added in the previous diff by the nullsafe tool, marked the class as nullsafe and ensured no remaining violations.
Changelog: [Android][Fixed] Made DynamicFromObject.java nullsafe
Reviewed By: alanleedev
Differential Revision: D72384066
fbshipit-source-id: 6f187f8a87a2c5d239c671880404eb81f0e22d3e
Summary:
Added nullsafe FIXMEs for easier reviewing of next diff, where we fix them
Changelog: [Internal]
Reviewed By: alanleedev
Differential Revision: D72384067
fbshipit-source-id: b9cc92e41f29cd5af4d277ee8ec0cb3c432bdeec
Summary:
Gone trough all the FIXMEs added in the previous diff by the nullsafe tool, marked the class as nullsafe and ensured no remaining violations.
Changelog: [Android][Fixed] Made DynamicFromMap.java nullsafe
Reviewed By: alanleedev
Differential Revision: D72384077
fbshipit-source-id: 70fb921fed06e9f89eb69c558692d1d7705fe2e5
Summary:
Added nullsafe FIXMEs for easier reviewing of next diff, where we fix them
Changelog: [Internal]
Reviewed By: alanleedev
Differential Revision: D72384073
fbshipit-source-id: fb9cc4d6da6ee78785e70c8b298434f61c60c1dd
Summary:
D65596278 marked the non-primitive return types from ReadableArray as optional, so we have to follow suit
Gone trough all the FIXMEs added in the previous diff by the nullsafe tool, marked the class as nullsafe and ensured no remaining violations.
Changelog: [Android][Fixed] Made DynamicFromArray.java nullsafe
Reviewed By: alanleedev
Differential Revision: D72384069
fbshipit-source-id: c67dc5bfb540af9190f740d565e5bda63d1caaa8
Summary:
Added nullsafe FIXMEs for easier reviewing of next diff, where we fix them
Changelog: [Internal]
Reviewed By: alanleedev
Differential Revision: D72384068
fbshipit-source-id: 83f4b75b19dcccf752e53fd301ccda7b42a5c611
Summary:
Gone trough all the FIXMEs added in the previous diff by the nullsafe tool, marked the class as nullsafe and ensured no remaining violations.
Changelog: [Android][Fixed] Made BaseJavaModule.java nullsafe
Reviewed By: alanleedev
Differential Revision: D72384078
fbshipit-source-id: aba0f261f3b3e77133ff2a148bf4903c73c54691
Summary:
Added nullsafe FIXMEs for easier reviewing of next diff, where we fix them
Changelog: [Internal]
Reviewed By: alanleedev
Differential Revision: D72384074
fbshipit-source-id: de616024dcca4c2d14b329aa020267c8a3d0ee56
Summary:
Gone trough all the FIXMEs added in the previous diff by the nullsafe tool, marked the class as nullsafe and ensured no remaining violations.
Changelog: [Android][Fixed] Made Arguments.java nullsafe
Reviewed By: cortinico
Differential Revision: D72384054
fbshipit-source-id: 87ad373d8663d8342d2ec8b757cec2a756210f45