-
[react native] npm run android - SDK location not found.Read | Write/Tech 2023. 8. 24. 14:53
아래는 error 구문입니다.
FAILURE: Build failed with an exception.
* What went wrong:
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/프로젝트 경로/android/local.properties'BUILD FAILED in 7s
5 actionable tasks: 5 up-to-date
Error: /Users/프로젝트 경로/android/gradlew exited with non-zero code: 1해결 방법은
react native 프로젝트 메인 경로에서 android 폴더에 local.properties를 수정하거나 생성합니다.
우선
안드로이드 SDK 위치를 파악한 후 /Users/유저명/Library/Android/sdk
react native 프로젝트 메인 경로에서
cd android
vi local.properties
vi 로 추가 또는 수정합니다.
아래 세팅을 추가하고 저장
sdk.dir = /Users/유저명/Library/Android/sdk
실행
npm run android --reset-cache
성공
'Read | Write > Tech' 카테고리의 다른 글
react-native pod install "iphoneos" cannot be located (0) 2023.09.22 vscode platformIO Serial moniter not working (0) 2023.09.09 [react-native] npx expo run:ios Error installing hermes-engine (0) 2023.08.22 상태바 설정 (0) 2023.08.22 react native 상태바 겹침 해결 (0) 2023.08.22