title: How to Fix Build Failed on React-Native run-android?
body: <p>So I'm getting this error</p>
  
  <pre><code>~/projects/personal-projects/react/myapp ⌚ 18:12:24
  $ react-native run-android --variant=release  
  Scanning folders for symlinks in /Users/user/projects/personal-projects/react/myapp/node_modules (22ms)
  JS server already running.
  Building and installing the app on the device (cd android &amp;&amp; ./gradlew installRelease)...
  
  FAILURE: Build failed with an exception.
  
  * What went wrong:
  A problem occurred configuring project ':app'.
  &gt; SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
  
  * Try:
  Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
  
  BUILD FAILED
  
  Total time: 14.706 secs
  Could not install the app on the device, read the error above for details.
  Make sure you have an Android emulator running or a device connected and have
  set up your Android development environment:
  https://facebook.github.io/react-native/docs/getting-started.html
  </code></pre>
  
  <p>I already have my android sdk installed and I also have java installed.</p>
  
  <p>this is what is in my <code>.bach_profile</code></p>
  
  <pre><code>export ANDROID_HOME=$HOME/Library/Android/sdk
  export PATH=$PATH:$ANDROID_HOME/tools
  export PATH=$PATH:$ANDROID_HOME/platform-tools
  export JAVA_HOME=$Home/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home
  </code></pre>
  
  <p>I've tried adding a local.properties file and added sdk.dir pointing to my Android/sdk folder. But still this error persists. How do I fix this?</p>