title: ionic build Android | error: No installed build tools found. Please install the Android build tools
body: <p>When I run <strong>ionic build android</strong> command in root of ionic project, I am getting this error:</p>
  
  <blockquote>
    <p>FAILURE: Build failed with an exception.</p>
    
    <ul>
    <li><p>Where: Script '/home/javad/Desktop/javadApp/platforms/android/CordovaLib/cordova.gradle'
    line: 64</p></li>
    <li><p>What went wrong: A problem occurred evaluating root project 'android'.</p>
    
    <blockquote>
      <p>No installed build tools found. Please install the Android build tools version 19.1.0 or higher.</p>
    </blockquote></li>
    <li><p>Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.</p></li>
    </ul>
  </blockquote>
  
  <pre><code>javad@javad:~/Desktop/javadApp$ ionic build android
  Running command: /home/javad/Desktop/javadApp/hooks/after_prepare/010_add_platform_class.js /home/javad/Desktop/javadApp
  add to body class: platform-android
  Running command: /home/javad/Desktop/javadApp/platforms/android/cordova/build 
  ANDROID_HOME=/opt/android-sdk
  JAVA_HOME=/usr/lib/jvm/default-java
  Running: /home/javad/Desktop/javadApp/platforms/android/gradlew cdvBuildDebug -b /home/javad/Desktop/javadApp/platforms/android/build.gradle -Dorg.gradle.daemon=true
  
  FAILURE: Build failed with an exception.
  
  * Where:
  Script '/home/javad/Desktop/javadApp/platforms/android/CordovaLib/cordova.gradle' line: 64
  
  * What went wrong:
  A problem occurred evaluating root project 'android'.
  &gt; No installed build tools found. Please install the Android build tools version 19.1.0 or higher.
  
  * 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: 1.564 secs
  
  /home/javad/Desktop/javadApp/platforms/android/cordova/node_modules/q/q.js:126
                      throw e;
                            ^
  Error code 1 for command: /home/javad/Desktop/javadApp/platforms/android/gradlew with args: cdvBuildDebug,-b,/home/javad/Desktop/javadApp/platforms/android/build.gradle,-Dorg.gradle.daemon=true
  ERROR building one of the platforms: Error: /home/javad/Desktop/javadApp/platforms/android/cordova/build: Command failed with exit code 8
  You may not have the required environment or OS to build this project
  Error: /home/javad/Desktop/javadApp/platforms/android/cordova/build: Command failed with exit code 8
      at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:134:23)
      at ChildProcess.EventEmitter.emit (events.js:98:17)
      at maybeClose (child_process.js:743:16)
      at Process.ChildProcess._handle.onexit (child_process.js:810:5)
  </code></pre>
  
  <p>in ~/.profile i have:</p>
  
  <blockquote>
    <p>export PATH=$PATH:/opt/android-sdk/tools </p>
    
    <p>export PATH=$PATH:/opt/android-sdk/platform-tools</p>
    
    <p>export PATH=$PATH:/opt/node/bin</p>
    
    <p>export JAVA_HOME=/usr/lib/jvm/default-java</p>
    
    <p>export ANDROID_HOME=/opt/android-sdk</p>
  </blockquote>
  
  <p>$PATH is:</p>
  
  <blockquote>
    <p>/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/opt/android-sdk/tools:/opt/android-sdk/platform-tools:/opt/node/bin</p>
  </blockquote>
  
  <p><strong>Important issue:</strong></p>
  
  <p><strong>in file:</strong>
  /home/javad/Desktop/javadApp/platforms/android/CordovaLib/cordova.gradle | <strong>line 38</strong>:</p>
  
  <pre><code>String[] getAvailableBuildTools() {
      def buildToolsDir = new File(getAndroidSdkDir(), "build-tools")
      buildToolsDir.list()
          .findAll { it ==~ /[0-9.]+/ }
          .sort { a, b -&gt; compareVersions(b, a) }
  }
  </code></pre>
  
  <p>just returned <strong>/opt/android-sdk/build-tools</strong>  !!!</p>
  
  <p>in <strong>/opt/android-sdk/build-tools</strong> folder i have:</p>
  
  <p><strong>android-5.1</strong> folder that extract from:
  <a href="https://dl.google.com/android/repository/build-tools_r22-linux.zip" rel="noreferrer">https://dl.google.com/android/repository/build-tools_r22-linux.zip</a></p>