1

I'm working on a react native project and trying to run the android version of my app for the first time. I have installed Android studio etc and when opening the project from AS I get the following error:

Failed to find Build Tools revision 25.0

I found a bunch of thread already referencing this error but couldn't find a detailed explanation on how to make it work.

What do people mean when they say "Point ANDROID_HOME to /usr/local/android-sdk" ?

This is my android config in android/app/build.gradle

android {
  compileSdkVersion 26
  buildToolsVersion '26.0.1'

  defaultConfig {
    applicationId "xxxxxxxxxxxxx"
    minSdkVersion 19
    targetSdkVersion 25
    versionCode 1
    versionName "1.0"
    multiDexEnabled true
    ndk {
      abiFilters 'armeabi-v7a', 'x86'
    }
    manifestPlaceholders = [
      .....
    ]
  }
...
}

And In have the following sdk installed:

sdk versions

Hugo
  • 2,073
  • 6
  • 23
  • 46

2 Answers2

1

This question's answer depends on the operating system.

On Windows

You need to set your environment variables, and set ANDROID_HOME to said path. After you restart, you should expect it to work like a charm. For Windows 10;

  1. In Search, search for and then select: System (Control Panel)
  2. Click the Advanced system settings link.
  3. Click Environment Variables.
  4. In the section System Variables, find the PATH environment variable and select it.
  5. Click Edit. If the PATH environment variable does not exist, click New.
  6. In the Edit System Variable (or New System Variable) window, specify the value of the PATH environment variable.
  7. Click OK. Close all remaining windows by clicking OK.

On OS X / Linux

You need to set it as a variable of your terminal.

  1. Go to your terminal's rc file (if you are not sure what this means, you are most probably using bash, and said file is ~/.bashrc)
  2. Add the following line to it (after filling blanks with your ANDROID_HOME location); export ANDROID_HOME=...... export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
  3. Save it, close and reopen your terminal. It should now work as expected.
Tukan
  • 2,253
  • 15
  • 17
0

Root cause of this issue most probably is that you have not set Environment variables properly. To build and run Android app you need to make sure that Java_Home and Android_Home path is set properly. Depending upon your operating system you can set these environment variables.

Now come to your "Point ANDROID_HOME to /usr/local/android-sdk". It means you need to set Android_Home path to /usr/local/android-sdk

To confirm if Android environment is set properly you can run adb command from terminal, if you will see some output it means Android Environment is ready to use.

Vikasdeep Singh
  • 20,983
  • 15
  • 78
  • 104