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

Crash on Android 14 (S24 Ultra) when setting edges prop on RNCSafeAreaView

Đang mở
#475 6 bình luận 8 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ả

### Description

I've encountered a crash in my React Native application on Android when trying to set the `edges` prop on `RNCSafeAreaView`. The application crashes with the following exception:

Exception com.facebook.react.bridge.JSApplicationIllegalArgumentException: Error while updating property 'edges' of a view managed by: RNCSafeAreaView
...
Caused by java.lang.ClassCastException: com.facebook.react.bridge.ReadableNativeMap cannot be cast to com.facebook.react.bridge.ReadableArray

This issue seems to be related to how the `edges` prop is handled in the native Android implementation of `RNCSafeAreaView`.

### Steps to Reproduce

1. Use `SafeAreaView` with the `edges` prop set to an array of strings, e.g., `edges={['top', 'left', 'right']}`.
2. Run the app on an Android device or emulator.

### Expected Behavior

The `SafeAreaView` should correctly apply the safe area insets according to the specified edges without causing a crash.

### Actual Behavior

The application crashes on Android with a `JSApplicationIllegalArgumentException` related to the `edges` prop.

### Environment

- React Native version: 0.73.4
- React Native Safe Area Context version: 4.9.0
- Device: S24 Ultra (I cannot reproduce in my device - S23 Ultra)

### Code Snippet

Here are the snippets from my code where I use `SafeAreaView`:

```jsx

...
```
### Additional Context
I've followed the documentation for react-native-safe-area-context and the usage of SafeAreaView seems to be correct according to the examples provided. This crash is blocking further development and testing on Android devices.

Any assistance or guidance on how to resolve this issue would be greatly appreciated.

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.