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

Support for React Native New Architecture on Android

Đang mở
#647 10 bình luận 2 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
2.8k
Fork
258
Merge trung bình
3 ngày 1 giờ
Pull request đã merge (30 ngày)
2

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.