Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details. 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:installDebug'. > 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/user/your-app/android/local.properties'.
というWarningが発生し、React NativeのビルドがFAILEDになっていた。
.zshrc
などにANDROID_SDK_ROOT
を定義するかlocal.properties
ファイルを作成し、sdk.dir
を定義する。今回は、local.properties
を作成する方で対応した。
touch /Users/user/your-app/android/local.properties
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. #Thu Dec 10 16:26:54 JST 2020 sdk.dir=/Users/user/Library/Android/sdk
android - Where is android_sdk_root? and how do I set it.? - Stack Overflow