Skip to content

ViewPager2 does not support direct child views , Cannot read property 'getViewManagerConfig' of null #1022

@adbhut-ashra-harns

Description

@adbhut-ashra-harns

Environment

react: 18.3.1
react-native: 0.76.9
react-native-pager-view: ^6.9.1
react-native-video: 5.2.1

Description

When using react-native-video inside react-native-pager-view, I encounter the error:

ViewPager2 does not support direct child views

As a result, the video does not play correctly. Since I am implementing tab navigation, using react-native-pager-view is required.

I downgraded react-native-video to version 5.2.1 for stability, but the issue persists. When testing with the latest version of react-native-video, the video component still does not behave as expected.

I have already updated my android/app/build.gradle file with the following dependencies:

implementation "androidx.viewpager2:viewpager2:1.1.0"
implementation "androidx.recyclerview:recyclerview:1.3.2"

However, the error remains.

It seems that the issue might be related to the package itself. Could you please provide guidance or a fix?

Reproducible Demo

Install the same dependencies and run the app. You should be able to reproduce the error consistently.

Screenshot

Error Screenshot

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions