appandflow / appandflow/react-native-safe-area-context

Support for React Native New Architecture on Android

未關閉
#647 10 則留言 2 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
TypeScript
星號
2.8k
分支
258
平均合併
3 天 1 小時
30 天內合併 PR
2

描述

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
```

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。