在Ionic3中获取“未找到已安装的构建工具”

时间:2018-09-29 07:59:05

标签: cordova ionic-framework

我遇到此错误,不知道如何解决。

    D:\Ionic\payment>ionic cordova build android
    Running app-scripts build: --platform android --target cordova
    [13:11:22]  build dev started ...
    [13:11:22]  clean started ...
    [13:11:22]  clean finished in 31 ms
    [13:11:22]  copy started ...
    [13:11:23]  deeplinks started ...
    [13:11:23]  deeplinks finished in 78 ms
    [13:11:23]  transpile started ...
    [13:11:37]  transpile finished in 13.83 s
    [13:11:37]  preprocess started ...
    [13:11:37]  preprocess finished in less than 1 ms
    [13:11:37]  webpack started ...
    [13:11:37]  copy finished in 15.46 s
    [13:11:50]  webpack finished in 12.61 s
    [13:11:50]  sass started ...
    [13:11:54]  sass finished in 3.79 s
    [13:11:54]  postprocess started ...
    [13:11:54]  postprocess finished in 31 ms
    [13:11:54]  lint started ...
    [13:11:54]  build dev finished in 31.82 s

> cordova build android
Android Studio project detected

ANDROID_HOME=D:\Android SDK\Android\Sdk\platform-tools
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_151
studio
Subproject Path: CordovaLib

Subproject Path: app
[13:12:07]  lint finished in 13.28 s
**FAILURE: Build failed with an exception.
* Where:
Script 'D:\Ionic\payment\platforms\android\CordovaLib\cordova.gradle' line: 68
* What went wrong:
A problem occurred evaluating project ':CordovaLib'.
> No installed build tools found. 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.
* Get more help at https://help.gradle.org
BUILD FAILED in 11s
cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* Where:
Script 'D:\Ionic\payment\platforms\android\CordovaLib\cordova.gradle' line: 68
* What went wrong:enter code here
A problem occurred evaluating project ':CordovaLib'.
> No installed build tools found. Install the Android build tools version 23.0.1 or higher.
* Try:
Run with --stacktrace o ption to get the stack traenter code herece. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 11s
[ERROR] An error occurred while running cordova build android (exit code 1).**

1 个答案:

答案 0 :(得分:0)

如果已安装Android Studio,并且ANDROID_HOME设置为适当的路径,请选择