• TIL

[RN] react-native-video (evaluating 'RCTVideolastance.Constants' error)

man_on 2022. 8. 27. 00:04
반응형

 

 

 

하단의 다크모드 버튼을 누르시면 좀 더 편안하게 보실 수 있습니다.

 

 

     


     

    react-native-video

     

    react native에서의 동영상 재생 라이브러리 사용법과

    react-native-video 사용시 빈번하게 발생하는 에러 해결방법

    render error null is not an object (evaluating 'RCTVideoInstance.Constants')

     

     

     

     

     

     


     

     

     

     

    react-native-video setting

     

     

    라이브러리 설치

    yarn add react-native-video

     

     

    Typescript사용 시

    yarn add @types/react-native-video

     

     

     


     

     

     

     

     

    TypeError  (or render) : undefined(null) is not an object

     

     

     

     

    render error null is not an object (evaluating 'RCTVideoInstance.Constants')

     

     

     

     

    [해결방법]

     

     

    1. install후 link를 해준다.

    yarn react-native link react-native-video

     

     

     

    2. Podfile에 해당 path를 추가해준다.

      pod 'react-native-video', :path => '../../../node_modules/react-native-video'

     

    추가 후 pod install

    cd ios && pod install

     

     

     

    3. 그래도 안된다면! 아래의 안내대로 Xcode에서 설정을 해준다.

     

    2번 targets에서 libRCTVideo.a를 추가할 때 TARGETS에 있는 두가지 항목(RETVideo / RCTVideo-tvOS) 모두 추가해줘야

    에러가 해결되었다.

     

     

     

     

     

    https://github.com/react-native-video/react-native-video/issues/541#issuecomment-354708996

     

    NativeModules.UIManager.RCTVideo.Constants · Issue #541 · react-native-video/react-native-video

    nhandled JS Exception: undefined is not an object (evaluating '_reactNative.NativeModules.UIManager.RCTVideo.Constants')

    github.com

     

     

     

     

    반응형