SIGN IN SIGN UP
facebook / react-native UNCLAIMED

A framework for building native applications using React

0 0 0 C++

fix: Prioritise local cpp (use default as fallback) (#48340)

Summary:
https://github.com/facebook/react-native/pull/47379 removed local cpp sources from the sources being built with the app. This resulted in a local `android/app/src/main/jni/OnLoad.cpp` file being ignored at build time. I have therefore added logic to the cmake file to prioritise local `cpp` files and fallback to `${REACT_ANDROID_DIR}/cmake-utils/default-app-setup/*.cpp` if none exist.

This resolves https://github.com/facebook/react-native/issues/48298

## Changelog:
[ANDROID] [FIXED] - Prioritise local OnLoad.cpp, falling back to default-app-setup

Pull Request resolved: https://github.com/facebook/react-native/pull/48340

Test Plan:
- Followed the https://reactnative.dev/docs/the-new-architecture/pure-cxx-modules guide (which was broken > 0.76.1)
- Applied the patch to the reproduction repository linked to https://github.com/facebook/react-native/issues/47352 to ensure no regression

Reviewed By: cipolleschi

Differential Revision: D67736012

Pulled By: cortinico

fbshipit-source-id: 87f6b8edf1613682585a94e1d1b3e6b4b792e4f5
T
timbocole committed
8b1f04987936ab2bc7dcf62adc92bf394d35f77b
Parent: a3c8e21
Committed by Facebook GitHub Bot <[email protected]> on 12/31/2024, 1:30:26 PM