Mac) react-native 환경설정 관련 오류들 (feat : android)

bebrain·2023년 10월 23일
0

오류 1.

error framework build type is static library react native

patching file config.sub
1 out of 1 hunks failed--saving rejects to config.sub.rej...

Looks like your iOS environment is not properly set.

해결방법

터미널에서

git config --global core.autocrlf input
git config --global --unset core.autocrlf

출처 : https://github.com/facebook/react-native/issues/34189


오류 2.

Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not determine the dependencies of null.
   > SDK location not found. Define a valid SDK location with an ANDROID_HOME environment variable or by setting the sdk.dir path in your project's local properties file at '/Users/.../Desktop/prac/AwesomeProject/android/local.properties'.

해결방법

프로젝트의 android폴더로 들어가서 local.properties파일을 생성해준 후

sdk.dir = /Users/맥사용자이름/Library/Android/sdk

를 붙여넣기 해준다.

출처 : https://stackoverflow.com/questions/27620262/sdk-location-not-found-define-location-with-sdk-dir-in-the-local-properties-fil


오류 3.

Error: Command failed with ENOENT: adb shell am start -n com.awesomeproject/com.awesomeproject.MainActivity -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
spawnSync adb ENOENT

해결방법

brew install --cask android-platform-tools

설치 후 adb --version 명령어로 확인했을 때 버전이 잘 나오면 설치된 것이다.

0개의 댓글