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

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

Aberta
#475 6 comentários 8 reações 0 responsáveis Ver no GitHub
Linguagem predominante
TypeScript
Estrelas
2.8k
Forks
258
Merge médio
3d 1h
PRs com merge (30d)
2

Descrição

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

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.