Ben Owen
Ben Owen

Reputation: 133

React Native cannot find Android Studio or SDK

OS: Ubuntu

Running npx react-native doctor yields:

results

As you can see react native does not recognise the existence of android studio or sdk.

I have configured my environment variables to the following:

export ANDROID_HOME=$HOME/opt/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

Exact path of Android studio:

/opt/android-studio-ide/android-studio/bin

Exact path of Android Sdk:

/opt/Android/Sdk

Android studios is installed and working, and by extension so is the sdk. I have followed the instructions on how to setup react and ensured all the correct packages have been added. See here:

Snippets from Android Studio

SDK Platforms

SDK Tools 1 SDK Tools 2

Upvotes: 7

Views: 3395

Answers (1)

Ben Owen
Ben Owen

Reputation: 133

The mistake I made was putting the $HOME variable in export ANDROID_HOME=$HOME/opt/Android/Sdk making the path /home/opt/Android/Sdk

Upvotes: 2

Related Questions