Skip to content

Crashes with the error: java.lang.NullPointerException: Attempt to read from field 'int android.view.View.mViewFlags' on a null object reference in method 'void android.view.ViewGroup.dispatchGetDisplayList()' #8422

@rpyoyo

Description

@rpyoyo

Description

I customized a Modal component using the Animated.View component with entering and exiting props. When the Modal closes and navigates to another screen, the app crashes with the error: java.lang.NullPointerException: Attempt to read from field 'int android.view.View.mViewFlags' on a null object reference in method 'void android.view.ViewGroup.dispatchGetDisplayList()'.
I tried removing the exiting prop, and the crash didn't happen.
Not all devices crash—most crashes are related to Oppo/Realme, etc.

Steps to reproduce

  1. create a project with expo (npx create-expo-app@latest)
  2. reset project (npm run reset-project)
  3. install dependency (npx expo install ahooks react-native-get-random-values uuid react-native-keyboard-controller react-native-paper)
  4. prebuild (expo prebuild)
  5. add two screen (index and test)
  6. add Modal component
  7. add a button to open a drawer on index screen
  8. navigate to test screen on Modal callback "onConfirm"
  9. build a release app and install to a device (oppo or realme)
  10. open the app in default index screen, click the button to open the drawer and then click the action
  11. the screen change to test screen and then the app crash

Snack or a link to a repository

https://github.com/rpyoyo/crash-reproduction-react-native-reanimated.git

Reanimated version

4.1.3

Worklets version

0.6.1

React Native version

0.81.4

Platforms

Android

JavaScript runtime

Hermes

Workflow

Expo Dev Client

Architecture

New Architecture (Fabric renderer)

Build type

Release app & production bundle

Device

Real device

Host machine

Windows

Device model

Realme GT Neo (RMX3350) Android 13

Acknowledgements

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Platform: AndroidThis issue is specific to AndroidRepro providedA reproduction with a snippet of code, snack or repo is providedReproducible 🎉

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions