question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

react-native doctor does not find ANDROID_HOME, ANDRIOD SDK and JDK

See original GitHub issue

Environment

System: OS: Windows 10 10.0.17763 CPU: (12) x64 Intel® Core™ i7-9750H CPU @ 2.60GHz Memory: 5.40 GB / 15.86 GB Binaries: Node: 12.18.0 - C:\Program Files\nodejs\node.EXE Yarn: Not Found npm: 6.14.5 - C:\Program Files\nodejs\npm.CMD Watchman: Not Found SDKs: Android SDK: Not Found IDEs: Android Studio: Version 3.6.0.0 AI-192.7142.36.36.6392135 Languages: Java: Not Found Python: 3.8.3 npmPackages: @react-native-community/cli: Not Found react: 16.13.1 => 16.13.1 react-native: 0.63.0 => 0.63.0 npmGlobalPackages: react-native: Not Found

Description

Cannot find Android SDK, JDK, or Android_HOME even though its all available, shown below: Annotation 2020-07-15 201018 Annotation 2020-07-15 201002

not sure if bug or other problem. This causes me to unable to do react-native run-android. Always shows the message below when I try to run it:

info Running jetifier to migrate libraries to AndroidX. You can disable it using “–no-jetifier” flag. Jetifier found 970 file(s) to forward-jetify. Using 12 workers… info JS server already running. ‘adb’ is not recognized as an internal or external command, operable program or batch file. info Launching emulator… error Failed to launch emulator. Reason: No emulators found as an output of emulator -list-avds. warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch. info Installing the app…

ERROR: JAVA_HOME is not set and no ‘java’ command could be found in your PATH.

Please set the JAVA_HOME variable in your environment to match the location of your Java installation.

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.bat app:installDebug -PreactNativeDevServerPort=8081

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! Breakout@0.0.1 android: react-native run-android npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the Breakout@0.0.1 android script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\micha\AppData\Roaming\npm-cache_logs\2020-07-16T00_00_37_647Z-debug.log

Reproducible Demo

Don’t know how to reproduce it.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:3
  • Comments:12

github_iconTop GitHub Comments

137reactions
mtsunucommented, Sep 10, 2020

This worked for me on windows 10:

Install android command line tools from android studio SDK manager (SDK tools tab). then add <YOUR_ANDROID_SDK_PATH>\cmdline-tools\latest\bin to PATH environment variables

17reactions
tungduonghgg123commented, Oct 1, 2021

This worked for me on windows 10:

Install android command line tools from android studio SDK manager (SDK tools tab). then add <YOUR_ANDROID_SDK_PATH>\cmdline-tools\latest\bin to PATH environment variables

Also work for MacOS. For me, I just download Android SDK Command-line Tools : Android Studio -> Preferences -> search for sdk -> Click SDK Tools -> Tick on Android SDK Command-line Tools-> Click OK to download. Then, the doctor should be able to find Android SDK. Screen Shot 2021-10-01 at 23 31 19

Read more comments on GitHub >

github_iconTop Results From Across the Web

react native - ReactNative can't locate Android SDK
I figured out that installing the "Android SDK Command-line Tools" plugin in Android Studio will allow doctor to recognize a newer android ...
Read more >
Fix React Native doctor Android errors
This post goes over how to fix React Native doctor errors for Android on macOS: JDK; Android Studio; Android SDK. Versions found: N/A ......
Read more >
React Native — SDK location not found. Define ...
React Native — SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
Read more >
Environment Setup | NativeScript
To find the actual location in the Android Studio Settings, navigate to Appearance & Behavior › System Settings › Android SDK and copy...
Read more >
react native doctor android studio not found
Or to save it forever, exporting the ANDROID_HOME with your Android sdk path. I solved it by exporting the ANDROID_HOME on my machine...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found