Ionic build android failed - no build-tools found


#1

I hava a ionic/cordova project, i wanted to emulate the project via emulator so i added the android platform using “ionic platform add android” command then i tried to run “ionic build android” command but it failed and the output is :

ionic build android

Running command: "C:\Program Files\nodejs\node.exe" "D:\web development\My-Stuff                                                                                                                s\ionic\Learn ionic by building apps\mynote\hooks\after_prepare\010_add_platform                                                                                                                _class.js" "D:/web development/My-Stuffs/ionic/Learn ionic by building apps/myno                                                                                                                te"
add to body class: platform-android
ANDROID_HOME=C:\Program Files (x86)\Android\android-sdk
JAVA_HOME=C:\Program Files\Java\jdk1.7.0_80
Failed to notify ProjectEvaluationListener.afterEvaluate(), but primary configur                                                                                                                ation failure takes precedence.
java.lang.IllegalStateException: buildToolsVersion is not specified.
        at com.google.common.base.Preconditions.checkState(Preconditions.java:17                                                                                                                6)
        at com.android.build.gradle.BasePlugin.createAndroidTasks(BasePlugin.jav                                                                                                                a:599)
        at com.android.build.gradle.BasePlugin$10$1.call(BasePlugin.java:566)
        at com.android.build.gradle.BasePlugin$10$1.call(BasePlugin.java:563)
        at com.android.builder.profile.ThreadRecorder$1.record(ThreadRecorder.ja                                                                                                                va:55)
        at com.android.builder.profile.ThreadRecorder$1.record(ThreadRecorder.ja                                                                                                                va:47)
        at com.android.build.gradle.BasePlugin$10.execute(BasePlugin.java:562)
        at com.android.build.gradle.BasePlugin$10.execute(BasePlugin.java:559)
        at org.gradle.listener.BroadcastDispatch$ActionInvocationHandler.dispatc                                                                                                                h(BroadcastDispatch.java:109)
        at org.gradle.listener.BroadcastDispatch$ActionInvocationHandler.dispatc                                                                                                                h(BroadcastDispatch.java:98)
        at org.gradle.listener.BroadcastDispatch.dispatch(BroadcastDispatch.java                                                                                                                :83)
        at org.gradle.listener.BroadcastDispatch.dispatch(BroadcastDispatch.java                                                                                                                :31)
        at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocat                                                                                                                ionHandler.invoke(ProxyDispatchAdapter.java:93)
        at com.sun.proxy.$Proxy13.afterEvaluate(Unknown Source)
        at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfte                                                                                                                rEvaluate(LifecycleProjectEvaluator.java:79)
        at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(L                                                                                                                ifecycleProjectEvaluator.java:65)
        at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProj                                                                                                                ect.java:504)
        at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProj                                                                                                                ect.java:83)
        at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(Task                                                                                                                PathProjectEvaluator.java:42)
        at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuil                                                                                                                dConfigurer.java:35)
        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(Default                                                                                                                GradleLauncher.java:129)
        at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradle                                                                                                                Launcher.java:106)
        at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLaun                                                                                                                cher.java:86)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildCon                                                                                                                troller.run(InProcessBuildActionExecuter.java:80)
        at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.jav                                                                                                                a:33)
        at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.jav                                                                                                                a:24)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProce                                                                                                                ssBuildActionExecuter.java:36)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProce                                                                                                                ssBuildActionExecuter.java:26)
        at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBu                                                                                                                ild.java:47)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(Build                                                                                                                CommandOnly.java:34)
        at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed                                                                                                                (DaemonCommandExecution.java:119)
        at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(                                                                                                                WatchForDisconnection.java:35)
        at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed                                                                                                                (DaemonCommandExecution.java:119)
        at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute                                                                                                                (ResetDeprecationLogger.java:24)
        at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed                                                                                                                (DaemonCommandExecution.java:119)
        at org.gradle.launcher.daemon.server.exec.StartStopIfBuildAndStop.execut                                                                                                                e(StartStopIfBuildAndStop.java:33)
        at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed                                                                                                                (DaemonCommandExecution.java:119)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(Forw                                                                                                                ardClientInput.java:71)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(Forw                                                                                                                ardClientInput.java:69)
        at org.gradle.util.Swapper.swap(Swapper.java:38)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(For                                                                                                                wardClientInput.java:69)
        at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed                                                                                                                (DaemonCommandExecution.java:119)
        at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClien                                                                                                                t.java:60)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(Build                                                                                                                CommandOnly.java:34)
        at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed                                                                                                                (DaemonCommandExecution.java:119)
        at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBu                                                                                                                ild(EstablishBuildEnvironment.java:70)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(Build                                                                                                                CommandOnly.java:34)
        at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed                                                                                                                (DaemonCommandExecution.java:119)
        at org.gradle.launcher.daemon.server.exec.DaemonHygieneAction.execute(Da                                                                                                                emonHygieneAction.java:39)
        at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed                                                                                                                (DaemonCommandExecution.java:119)
        at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.                                                                                                                run(StartBuildOrRespondWithBusy.java:46)
        at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(Daemon                                                                                                                StateCoordinator.java:246)
        at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecut                                                                                                                orImpl$1.run(DefaultExecutorFactory.java:64)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.                                                                                                                java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor                                                                                                                .java:615)
        at java.lang.Thread.run(Thread.java:745)

FAILURE: Build failed with an exception.

* Where:
Script 'D:\web development\My-Stuffs\ionic\Learn ionic by building apps\mynote\p                                                                                                                latforms\android\CordovaLib\cordova.gradle' line: 64

* What went wrong:
A problem occurred evaluating root project 'android'.
> 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 mins 16.86 secs
ERROR building one of the platforms: Error code 1 for command: cmd with args: /s                                                                                                                ,/c,""D:\web development\My-Stuffs\ionic\Learn ionic by building apps\mynote\pla                                                                                                                tforms\android\gradlew" cdvBuildDebug -b "D:\web development\My-Stuffs\ionic\Lea                                                                                                                rn ionic by building apps\mynote\platforms\android\build.gradle" -Dorg.gradle.da                                                                                                                emon=true -Pandroid.useDeprecatedNdk=true"
You may not have the required environment or OS to build this project
Error: Error code 1 for command: cmd with args: /s,/c,""D:\web development\My-St                                                                                                                uffs\ionic\Learn ionic by building apps\mynote\platforms\android\gradlew" cdvBui                                                                                                                ldDebug -b "D:\web development\My-Stuffs\ionic\Learn ionic by building apps\myno                                                                                                                te\platforms\android\build.gradle" -Dorg.gradle.daemon=true -Pandroid.useDepreca                                                                                                                tedNdk=true"

my system information :

Cordova CLI: 6.0.0
Ionic Version: 1.2.4
Ionic CLI Version: 1.7.14
Ionic App Lib Version: 0.7.0
OS: Windows 7 SP1
Node Version: v4.4.0

the error says you don’t have build-tools but I have one !

my android sdk image
https://drive.google.com/file/d/0B8jEsdhnCspWMzIySDZoaVBudjQ/view?usp=sharing


#2

no one here having the same issue as mine? that’s impossible, any suggestion at least?


#3

hi,

try to open android sdk manager
and select in the tools section

android sdk tools
android sdk platform-tools
android sdk build-tools

and check that you have a sdk-platform installed (android 6 API 23 )


#4

ok I checked it out and i have all of them, here is a image of my android sdk @ItamarCohen ttps://drive.google.com/open?id=0B8jEsdhnCspWMzIySDZoaVBudjQ


#5

you need to grant me access to see the image


#6

sorry my bad, now you can access the image @ItamarCohen
https://drive.google.com/open?id=0B8jEsdhnCspWMzIySDZoaVBudjQ


#7

I had updated my first post and added the sdk image


#8

hi,

can you copy paste the config.xml and AndroidManifest.xml


#9

hi
androidmanifest.xml
<?xml version='1.0' encoding='utf-8'?>












confix.xml file

<?xml version='1.0' encoding='utf-8'?>
<widget id="com.ionicframework.testapp510173" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <preference name="loglevel" value="DEBUG" />
    <feature name="Device">
        <param name="android-package" value="org.apache.cordova.device.Device" />
    </feature>
    <feature name="SplashScreen">
        <param name="android-package" value="org.apache.cordova.splashscreen.SplashScreen" />
        <param name="onload" value="true" />
    </feature>
    <feature name="StatusBar">
        <param name="android-package" value="org.apache.cordova.statusbar.StatusBar" />
        <param name="onload" value="true" />
    </feature>
    <feature name="Whitelist">
        <param name="android-package" value="org.apache.cordova.whitelist.WhitelistPlugin" />
        <param name="onload" value="true" />
    </feature>
    <feature name="Keyboard">
        <param name="android-package" value="io.ionic.keyboard.IonicKeyboard" />
        <param name="onload" value="true" />
    </feature>
    <icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
    <icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" />
    <icon density="hdpi" src="resources/android/icon/drawable-hdpi-icon.png" />
    <icon density="xhdpi" src="resources/android/icon/drawable-xhdpi-icon.png" />
    <icon density="xxhdpi" src="resources/android/icon/drawable-xxhdpi-icon.png" />
    <icon density="xxxhdpi" src="resources/android/icon/drawable-xxxhdpi-icon.png" />
    <splash density="land-ldpi" src="resources/android/splash/drawable-land-ldpi-screen.png" />
    <splash density="land-mdpi" src="resources/android/splash/drawable-land-mdpi-screen.png" />
    <splash density="land-hdpi" src="resources/android/splash/drawable-land-hdpi-screen.png" />
    <splash density="land-xhdpi" src="resources/android/splash/drawable-land-xhdpi-screen.png" />
    <splash density="land-xxhdpi" src="resources/android/splash/drawable-land-xxhdpi-screen.png" />
    <splash density="land-xxxhdpi" src="resources/android/splash/drawable-land-xxxhdpi-screen.png" />
    <splash density="port-ldpi" src="resources/android/splash/drawable-port-ldpi-screen.png" />
    <splash density="port-mdpi" src="resources/android/splash/drawable-port-mdpi-screen.png" />
    <splash density="port-hdpi" src="resources/android/splash/drawable-port-hdpi-screen.png" />
    <splash density="port-xhdpi" src="resources/android/splash/drawable-port-xhdpi-screen.png" />
    <splash density="port-xxhdpi" src="resources/android/splash/drawable-port-xxhdpi-screen.png" />
    <splash density="port-xxxhdpi" src="resources/android/splash/drawable-port-xxxhdpi-screen.png" />
    <name>testapp</name>
    <description>
        An Ionic Framework and Cordova project.
    </description>
    <author email="you@example.com" href="http://example.com.com/">
      Your Name Here
    </author>
    <content src="index.html" />
    <access origin="*" />
    <preference name="webviewbounce" value="false" />
    <preference name="UIWebViewBounce" value="false" />
    <preference name="DisallowOverscroll" value="true" />
    <preference name="android-minSdkVersion" value="16" />
    <preference name="BackupWebStorage" value="none" />
    <preference name="SplashScreen" value="screen" />
    <preference name="SplashScreenDelay" value="3000" />
</widget>