React Native - SDK location not found.

Qnoze·2024년 1월 31일

React-Native

목록 보기
4/4

React-Native 에서 안드로이드 애뮬레이터를 실행할 때 이러한 문제가 나타났다

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/qnoze/Project/voice-collector-application/voiceCollectorApp/android/local.properties'.

이러한 에러가 났을 때 간단한 해결방법을 알아보았다. 우선 SDK의 위치가 없어서 생기는 에러임을 알 수 있다.

해결 방법

  1. React Native root 프로젝트에서 android 디렉토리로 접근한다.
  2. android 디렉토리에서 local.properties 파일을 생성한다.
    아래 코드를 입력한다.
  • 맥 유저
sdk.dir = /Users/**USERNAME**/Library/Android/sdk
  • 윈도우 유저
sdk.dir=C\:\\Users\\**USERNAME**\\AppData\\Local\\Android\\sdk

0개의 댓글