Ask a question+
$18.78Can't not run-android react native. Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
Hello developer I’m new in react native in macOS catalina,
I’m facing this error when try to open react-native run-android
`* What went wrong:
A problem occurred configuring project ‘:react-native-reanimated’.
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/vucms/Desktop/REACT-NATIVE/micro-controller-garden-helper/Mobile/android/local.properties’.
Run with —stacktrace option to get the stack trace. Run with —info or —debug option to get more log output. Run with —scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 12s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with —verbose flag for more details.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081`
You need to add ENVIROMENT VARIABLE to your system path
export ANDROID_HOME=$HOME/Library/Android/sdk export PATH=$PATH:$ANDROID_HOME/emulator export PATH=$PATH:$ANDROID_HOME/tools export PATH=$PATH:$ANDROID_HOME/tools/bin export PATH=$PATH:$ANDROID_HOME/platform-tools
The SDK Manager can be accessed from the “Welcome to Android Studio” screen. Click on “Configure”, then select “SDK Manager”.
Android Studio Welcome
The SDK Manager can also be found within the Android Studio “Preferences” dialog, under Appearance & Behavior → System Settings → Android SDK.
Select the “SDK Platforms” tab from within the SDK Manager, then check the box next to “Show Package Details” in the bottom right corner. Look for and expand the Android 9 (Pie) entry, then make sure the following items are checked:
Android SDK Platform 28
Intel x86 Atom_64 System Image or Google APIs Intel x86 Atom System Image
Next, select the “SDK Tools” tab and check the box next to “Show Package Details” here as well. Look for and expand the “Android SDK Build-Tools” entry, then make sure that 28.0.3 is selected.
Finally, click “Apply” to download and install the Android SDK and related build tools.
- Configure the ANDROID_HOME environment variable
The React Native tools require some environment variables to be set up in order to build apps with native code.
Open the System pane under System and Security in the Windows Control Panel, then click on Change settings…. Open the Advanced tab and click on Environment Variables…. Click on New… to create a new ANDROID_HOME user variable that points to the path to your Android SDK:
ANDROID_HOME Environment Variable
The SDK is installed, by default, at the following location:
You can find the actual location of the SDK in the Android Studio “Preferences” dialog, under Appearance & Behavior → System Settings → Android SDK.
Open a new Command Prompt window to ensure the new environment variable is loaded before proceeding to the next step.
- Add platform-tools to Path
Open the System pane under System and Security in the Windows Control Panel, then click on Change settings…. Open the Advanced tab and click on Environment Variables…. Select the Path variable, then click Edit. Click New and add the path to platform-tools to the list.
The default location for this folder is:
export ANDROID_HOME=$HOME/Android/Sdk export PATH=$PATH:$ANDROID_HOME/emulator export PATH=$PATH:$ANDROID_HOME/tools export PATH=$PATH:$ANDROID_HOME/tools/bin export PATH=$PATH:$ANDROID_HOME/platform-tools
- 1How can I filter questions by programming language in Stack Dev?
- 1How to compress and extract files/folders using the tar command on Ubuntu
- 5What is "marquee" tag and how I can use it in HTML?
- 6how to check if object is empty or not.
- 2how to check is array symmetrical or not?
- 1Can't add AMP Variable for Google Tag Manager
- 2Can't run flutter project: No connected device
- 1How to run symfony application with https in local environment
- 1How to update parent state from child component in React?
- 2How to run Nuxt app with forever