React Native 개발 환경 A to M for Mac

cadenzah·2024년 4월 19일
0

React Native

목록 보기
1/1
post-thumbnail

2024년 4월 19일 기준 유효합니다.

모든 경우를 모조리 다루는 것은 불가능하고 직접 마주친 것들만 추렸으니... A와 Z의 중간인 M 정도로 쳐도 무방하지 않을까?

공식문서가 짱

https://reactnative.dev/docs/environment-setup

gem install cocoapods 했을 때 오류가 나면

android 빌드 환경 설정시

이제 OpenJDK 쓰지 말자. Temurin 도 쓰지 말자.
brew install --cask zulu17

yarn ios 시에 실패하면

/ios 들어가서 pod install 했는지 확인

pod install 시에 error: unable to lookup item 'Path' in 'iphoneos' 오류 발생하면

https://codechef.tistory.com/entry/react-native-프로젝트-초기-설치-후-error-unable-to-lookup-item-Path-in-SDK-iphoneos-간단-해결-방법

No simulator available with name "iPhone 14". 오류 발생시

  • react-native마다 simulator의 default값이 정해져있다.
  • xcode를 열어서 지원하는 기기 중 하나를 정해 옵션에 추가하여 실행한다.

yarn ios --simulator='iPhone 15 Pro

yarn ios 했을 때 빌드 실패하면

Yarn이 실행되는 터미널이 아니라 Xcode 열어서 빌드 원인을 확인하자.

Xcode build 시 module map file ... not found 에러

Xcode에서 xcworkspace 를 열어야 한다. xcdoeproj가 아니라.

FlipperKit 관련 오류 (FlipperPlatformWebSocket.mm 관련 빌드 오류시)

Pods/Flipper/FlipperTransportTypes.h 의 9번째 라인에 #include <functional> 추가

Android 빌드시 SDK 관련 오류 발생시

Dependency 'androidx.appcompat:appcompat-resources:1.5.0' requires libraries and applications that
   depend on it to compile against version 32 or later of the
   Android APIs.
     
   :app is currently compiled against android-31.
     
   Recommended action: Update this project to use a newer compileSdkVersion
   of at least 32, for example 32.

(따라하기 도중) 라이브러리 설치시 SDK 관련 오류 발생시

라이브러리가 업그레이드되어 그런 것이면, Major version 을 낮추어 설치해보자.

  • react-native-screens 가 문제라면, 3.14.0 버전으로 설치 시도

프로젝트의 용량 줄이기 (ft. 미사용 프로젝트 보관하기)

빌드했을 때 생성되는 라이브러리 소스 관련 아래 파일은 제거해도 된다.

  • /node_modules/: Web 관련
  • /ios/Pods/: iOS 관련
  • /android/app/build/: Android 관련

0개의 댓글

관련 채용 정보