Android SDK Not Found Macos - React Native Setup

267 Views Asked by At

I am facing Error even after having correct env paths and sdk Installed, When I run yarn react-native doctor, it shows that no sdk verion found, below is attached s shot

enter image description here

Here is my env vars in zsh config

export PATH="/usr/local/opt/ruby/bin:$PATH"
export ANDROID_HOME=/Users/mac/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/build-tools
export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_HOME/emulator
export JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home

Here is attached android studio settings

enter image description here

enter image description here

enter image description here

enter image description here

I tried all method available to solve problem

1

There are 1 best solutions below

0
Hamza khalid On

I've faced the same problem I tried all the possible solution but all in vain but I found out a little hack you can still run your application by using. npx react-native start when you do this it will find a file named local.properties .Sometimes while creating the project it is not there so you will create it manually and put the following:

sdk.dir = /Users/username/Library/Android/sdk
ndk.dir = /Users/username/Library/Android/ndk
build.tools.version = 28.0.3
java.home = /Library/Java/Java JDK 11.0.11.jdk
adb.exe = /Users/username/Library/Android/sdk/platform-tools/adb

replace the username here with your own username and java.home with you own JAVAHOME path then even the doctor says the android studio sdk is not here your application still build and run the file will be created here local.properties file location