본문 바로가기
JavaScript/React-native

[React Navigation] RNSScreenStackHeaderConfig was not found in the UIManager

by 비븽 2023. 6. 28.

리액트 네이티브 네비게이션을 쓰기위해 작성하는 게시글 

도움을 받은 블로그: [React Native] React Navigation 설치 및 사용법 (tistory.com)

 

 

-

 

react-native버전은 0.67.3이다.

네비게이션 의존패키지 설치가 덜 되서 그런거라고 한다.

npm install react-native-gesture-handler
npm install react-native-screens
npm install @react-native-community/masked-view
npm install react-native-safe-area-context

// 설치안해도 돌아가는데 잘 모르겠음
npm install react-native-reanimated

위 다섯개를 설치 후 pod install을 해주면된다...만, 밑의 두개를 설치 시 오류가 난다. 나의 경우는 react-native-reanimated를 설치하지 않아도 네비게이션이 실행이 되어 이것은 설치하지않았다. 그러나 react-native-safe-area-context는 설치를 해주어야한다.

 

 

1) react-native-safe-area-context 설치 후 pod install이 안되는 오류

[!] CocoaPods could not find compatible versions for pod "react-native-safe-area-context":
  In Podfile:
    react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`)

Specs satisfying the `react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`)` dependency were found, but they required a higher minimum deployment target.

 

이건 간단하게 해결했다. podfile에 들어가서 platform의 버전을 실행하려는 시뮬레이터 버전과 똑같이 맞추면 된다. 나는 iphone13 (ios 15.0) 시뮬레이터를 쓰고 있으므로 15.0 으로 맞춰주고 pod install 을 하면 성공

platform :ios, '15.0'