React Native/React Native_error

[React Native - android] SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at ...

bocoder
728x90
반응형

 

* '맥북A'에서 개발하던 내용을 github 에 업로드 후, '맥북B'로 clone 하여 빌드 시 오류

 

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at '/Users/.../android/local.properties'.

 

로그에 나와있는 것처럼 local.properties 파일에 sdk.dir path 설정을 확인하니 파일 자체가 없다.

path가 설정된 local.properties 파일을 추가하여 해결.

 

# Project > android > local.properties

## This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
#
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.

sdk.dir=/Users/.../Library/Android/sdk
728x90
반응형