React Native android build failed. SDK location not found

Pyae Sone Nyein picture Pyae Sone Nyein · Sep 17, 2015 · Viewed 361.2k times · Source

I have error when i start running android

What went wrong:
A problem occurred evaluating project ':app'.  
> SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.

Answer

Ravin picture Ravin · Sep 17, 2015
  • Go to the android/ directory of your react-native project
  • Create a file called local.properties with this line:
sdk.dir = /Users/USERNAME/Library/Android/sdk

Where USERNAME is your macOS username