appandflow / appandflow/react-native-safe-area-context
Support for React Native New Architecture on Android
- Vorherrschende Sprache
- TypeScript
- Sterne
- 2.8k
- Forks
- 258
- Ø Merge
- 3 T. 1 Std.
- Gemergte PRs (30 T.)
- 2
Beschreibung
As mentioned in the docs https://appandflow.github.io/react-native-safe-area-context/#new-architecture-support the new architecture support is experimental. My question, is there an official timeline or roadmap for full New Architecture support on Android, or potentially a work around?
We have recently upgraded to react-native-safe-area-context v5.5.2 in a React Native 0.79.2 project and enabled the New Architecture on Android by setting `newArchEnabled=true` in `android/gradle.properties`.
To work around this we created a patch (applied via patch-package) that tweaks the library’s CMakeLists.txt, adding missing include directories and adjusting target_link_libraries. This restores the build, but every version bump forces us to re-patch.
**Reproduction steps**
1. Start a fresh RN 0.79.2 app (`npx react-native@latest init MyApp --version 0.79.2`).
2. Install `react-native-safe-area-context@5.5.2`.
3. Enable new architecture: set `newArchEnabled=true` in `android/gradle.properties`.
4. Run `react-native run-android`.
5. Observe CMake link errors.
**Environment**
- react-native-safe-area-context: 5.5.2
- React Native: 0.79.2
- Android Gradle Plugin: 8.4.0
- CMake: 3.22.1 (default in AGP 8.x)
- Gradle: 8.7
- Build flavor: new architecture enabled
Patch sample (for reference)
```
# react-native-safe-area-context/android/CMakeLists.txt
- target_link_libraries(safeareacontextreactnativemodule ...)
+ target_include_directories(safeareacontextreactnativemodule PRIVATE ${REACT_ANDROID_DIR}/...)
+ target_link_libraries(safeareacontextreactnativemodule
+ ReactAndroid::fabricjni
+ ReactAndroid::react_nativemodule_core
+ ...) # additional libs required under NewArch
```
Beitragsleitfaden
Bewertung
Dieses Issue wurde noch nicht bewertet.