본문 바로가기
오늘의뻘짓

[react-native] 리액트네이티브 셋팅 오류 (AIRMAP,styled component 설치 에러)

by 강갱민 2024. 5. 9.

하 ..ㅋㅋ 오랜만에 리액트 네이티브 지도 앱 만들어보려했는데 오류 한뭉텅이 일어난다.

 

1번 오류 AIRMAP

먼데 이건 ..ㅋㅋㅋㅋ

Invariant Violation: requireNativeComponent: "AIRMap" was not found in the UIManager.

 

해결책 :

 

react-native.config.js 이라는 파일 만들고 (루트 파일경로에)

아래코드 넣어주면된다 

 

module.exports = {
    project: {
        android: {
            unstable_reactLegacyComponentNames: [
                'AIRGoogleMap',
                'AIRMap',
                'AIRMapMarker',
                'PanoramaView'
            ],
        },
        ios: {
            unstable_reactLegacyComponentNames: [
                'AIRGoogleMap',
                'AIRMap',
                'AIRMapMarker',
                'PanoramaView'
            ],
        },
    },
};

 

2번 오류 styled component 

 

이건또 뭔데 스타일 컴포넌트 설치 왜안되는데 

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree

 

해결책 :

 

리액트 네이티브 루트 폴더 경로에 .npmrc 파일을 생성하고 아래 코드 붙여넣기 그러면 해결

legacy-peer-deps=true