Site icon Coding is Love

Fix React native doctor issues (solved)

React native doctor is a diagnostics tool which can help you find if your PC has all the setup for react native development. React native doctor can show certain issues. Let’s see how to solve them

React native doctor jdk not found

If you come across this issue that jdk is not found. Then you can quickly install it.

First install chocolatey from the here

Then install jdk using this command:

choco install -y microsoft-openjdk11

ANDROID_HOME not found

In this case, Make sure that you have an environment variable named ANDROID_HOME setup. Here’s a screenshot for reference.

If you’ve already setup ANDROID_HOME env variable then try the next step

Make sure that you have Android SDK manager. If you dont have it, then 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

ANDROID_SDK not found

The same solution applies to this as well

Make sure that you have Android SDK manager. If you dont have it, then 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

Android studio not detected

Same solution applies to this as well

Make sure that you have Android SDK manager. If you dont have it, then 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

If react native doctor is still not detecting android studio then you’ve probably installed Android studio in a custom path. If this is the case then React native doctor will not detect android studio. It will still keep showing it as an issue whenever you run react-native doctor’s diagnostics.

But that’s okay, you can go ahead and build your React native app and it should build as expected.

Android SDK build tools supported version not found

If the error says something like supported versions 33.0, 31.0 but found 33.2 then you should install the exact build tools version.

You can do this bu opening the SDK manager from Android studio > Select SDK tools tab > Tick “Show package details”. Now you can select the exact build tools version mentioned in the error and click apply. That should solve the unsupported version issue. Here’s a screenshot of the SDK manager’s build tools tab.

Conclusion

These are the solutions to various issues that arise while running react-native diagnostics. Hope it helps ✌🏻

Exit mobile version