
환경
Mac OS 13.2
Xcode 14.2
React Native v0.70.5 ( v0.71.3 is currently newer)
node 16.0.0
expo ~47.0.12
프로젝트 생성
dear-diary 라는 이름의 프로젝트 생성
--use-npm : npm 을 이용하여 의존성설치를 하겠다.
npx create-react-native-app dear-diary --use-npm
Default new app (선택)
cd dear-diary
expo splashscreen 을 기본 템플릿에 포함하기를 원한다면,
npx create-react-native-app -t with-splash-screen
# 단, with-splash-screen 템플릿을 선택한다면 ios/android 폴더가 생성되지 않고 cocoapod 을 비롯한 모듈도 설치되지 않더라.
# 또한 시뮬레이터가 expo go 로 실행하는 package.json 파일을 얻는다.
React navigation native 설치
npm install @react-navigation/native
#의존성 설치
npx expo install react-native-screens react-native-safe-area-context
If you're on a Mac and developing for iOS,
npx pod-install ios
Stack Navigation 설치
npm install @react-navigation/native-stack
styled-components 설치
# with npm
npm i styled-components
#또는
npm install --save styled-components
styled-components의 자동완성기능 추가하기
npm install @types/styled-components @types/styled-components-react-native
실행시 시뮬레이터 지정하기
npx react-native run-ios --simulator='iPhone SE (3rd generation)'
또는 package.json 을 수정해둔 후 실행한다.
package.json
"scripts": {
"start": "expo start --dev-client",
"android": "expo run:android",
"ios": "react-native run-ios --simulator='iPhone 12 Pro Max'",
"web": "expo start --web"
},
이후 npm run ios 로 실행한다.
혹시 첫 실행 도중 아래와 같은 에러가 난다면
❌ (node_modules/expo-modules-core/ios/Swift/DynamicTypes/DynamicEnumType.swift:7:21)
5 | */
6 | internal struct DynamicEnumType: AnyDynamicType {
> 7 | let innerType: any Enumerable.Type
| ^ consecutive declarations on a line must be separated by ';'
8 |
9 | func wraps<InnerType>(_ type: InnerType.Type) -> Bool {
10 | return innerType == InnerType.self
Expo - npm run ios gets "exited with error code 65" after expo prebuild
I can't prebuild my project and run it afterward, so I tried it on a new project. Here are the steps I followed : > npx create-expo-app appName > cd appName > expo prebuild > npm run ios
stackoverflow.com
나는 위와 같은 문제가 MacOs 13.2 , xcode 13.2에서 발생해서 MocOS 13.2(최신) , xcode 14.2로 업데이트 했다. (결과 ,잘 실행됨)
다음글
다이어리 앱을 만들면서 연습해보자. - 모듈설치 /Home / Write Screen
이전글 2023.01.31 - [개발로그/ReactNative] - [dear-diary] 처음부터 다시 해보는 npx create-react-native-app dear-diary with ios 세팅! 나만의 프리셋 설치 리엑트 네비게이션 설치 #리엑트 네비게이션 설치 npm install
greenerydeveloper.tistory.com
끝
'개발로그 > ReactNative' 카테고리의 다른 글
2023. ver2. admob IOS 앱 첫 연동하기 예제 CRNA app (Expo Dev Client and EAS CLI) (0) | 2023.02.06 |
---|---|
에러가 있는 코드로부터 배운다. React Native Animated 에서의 Value 수정하기(useRef) (0) | 2023.02.01 |
React Native Animated - 애니메이션 value 를 수정하기 위해 사용하는 것들. 예제 포함 (0) | 2023.01.31 |
react native Animated 를 사용할때 알아야할 절대 Rules! (0) | 2023.01.31 |
처음부터 해보는 npx react-native init AwesomeProject with ios 세팅! 나만의 프리셋 (0) | 2023.01.30 |
**BUILD FAILD** xcode_env_generator 를 생성시키는 버전으로 expo-modules-autolinking 의 버전을 맞춰보자. (0) | 2023.01.29 |
React Query 에서 모든 캐쉬된 쿼리에 권한을 갖는 QueryClient 사용법 그리고 개념정리 (0) | 2023.01.27 |
CRNA로 만들어진 사이드프로젝트 Netflify 앱- Movies 화면 스냅샷 (0) | 2023.01.26 |
댓글