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

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

Abierto
#475 6 comentarios 8 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
TypeScript
Estrellas
2.8k
Forks
258
Merge medio
3 d 1 h
PR fusionados (30 d)
2

Descripción

### 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.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.