离子cordova构建android - 失败

时间:2017-10-07 15:56:45

标签: cordova ionic-framework

在尝试为Android平台构建离子应用程序时,我收到以下错误以安装Android构建工具,但我已经在我的PATH变量和ANDROID_HOME中配置了sdkmanager。请帮帮我。

系统变量:

%ANDROID_HOME%= K:/ android-sdk %PATH%=%APTH%/%ANDROID_HOME%/ tools / bin

输出%ANDROID_HOME%/ tools / bin / sdkmanager --list

Available Updates:
  ID      | Installed | Available
  ------- | -------   | -------
  tools   | 26.0.1    | 26.1.1
done

错误:

[21:12:35]  lint finished in 4.37 s
× Running command - failed!
[ERROR] An error occurred while running cordova build android (exit code 1):


        (truncated) ... eLauncher$1.execute(DefaultGradleLauncher.java:161)
                at org.gradle.initialization.DefaultGradleLauncher$1.execute(DefaultGradleLauncher.java:158)
                at org.gradle.internal.Transformers$4.transform(Transformers.java:169)
                at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106)


        FAILURE: Build failed with an exception.

        * Where:
        Script 'K:\mobileApp\platforms\android\CordovaLib\cordova.gradle' line:
        64

        * What went wrong:
        A problem occurred evaluating root project 'android'.
        > No installed build tools found. Install the Android build tools version 19.1.0 or higher.

2 个答案:

答案 0 :(得分:1)

config.xml

中查看Android版本

应该是这样的:

 <engine
  name="android"
  spec="^6.2.3"/>

答案 1 :(得分:1)

将PATH变量扩展为指向Android平台工具,即

mutation

希望这能解决你的错误!