EPguy
[React-Native, Android] Invariant Violation: requireNativeComponent: "RNSScreenStackHeaderConfig" was not found in the UIManager 에러 해결법 본문
개발/React-Native
[React-Native, Android] Invariant Violation: requireNativeComponent: "RNSScreenStackHeaderConfig" was not found in the UIManager 에러 해결법
EPguy 2023. 9. 26. 15:25원인
아래 공식문서에 있는 내용을 따라하지 않으면 에러가 발생합니다.
해결방법
1. react-native-screens react-native-safe-area-context 라이브러리 설치npm install react-native-screens react-native-safe-area-context
2. MainActivity.java 수정
아래 경로에 있는 MainActivity.java를 수정해야합니다.android/app/src/main/java/<your package name>/MainActivity.java
아래 코드를 추가해주세요.
import android.os.Bundle;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(null);
}
3. 프로젝트 재시작하기
설정을 반영하려면 재시작이 필요합니다.
npm run android
'개발 > React-Native' 카테고리의 다른 글
[RTK Query] 다른 createApi 객체의 태그를 무효화 하는 방법 (0) | 2024.03.27 |
---|---|
[React-Native] 명령어 하나로 간단하게 최신버전으로 업그레이드 하기 (0) | 2023.09.26 |
[React, React-Native] RTK Query를 사용하여 AccessToken, RefreshToken 관리하기 (0) | 2023.01.03 |