离子科尔多瓦构建Android - 失败(ionic cordova build android

2019-10-29 03:14发布

而试图建立Android平台,我提示以下错误:安装Android构建工具离子的应用程序,但我已经在我的PATH变量和ANDROID_HOME配置sdkmanager为好。 请帮我在这。

系统变量:

%ANDROID_HOME%= K:/ Android的SDK%PATH%=%APTH%/%ANDROID_HOME%/工具/箱

%ANDROID_HOME%/工具/箱的输出/ 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.

Answer 1:

扩展您的PATH变量指向的Android平台工具即。

%PATH% = %PATH%/%ANDROID_HOME%/platform-tools

希望这可以解决您的错误!



Answer 2:

检查你的Android版本在你的config.xml

它应该是这样的:

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


文章来源: ionic cordova build android - failed