【问题标题】:Ionic Build android Error with Exit code 1Ionic Build android Error with Exit code 1
【发布时间】:2017-01-29 04:26:01
【问题描述】:

构建失败

C:\Program Files\Android\Sdk\tools\ant\build.xml:716: The following error occurr
ed while executing this line:
C:\Program Files\Android\Sdk\tools\ant\build.xml:730: Compile failed; see the co
mpiler error output for details.

总时间:2秒

F:\todo\Ionic\Teller\src\platforms\android\cordova\node_modules\q\q.js:126 扔 e; ^ 命令的错误代码 1:带有 args 的 cmd: /s,/c,ant,debug,-f,F:\Verifast\Ionic\Te ller\src\platforms\android\build.xml,-Dout.dir=ant-build,-Dgen.absolute.dir=ant- 生成错误构建平台之一:错误:cmd:命令失败 退出代码为 1

您可能没有构建此项目所需的环境或操作系统错误:cmd:命令失败,退出代码为 1

请帮忙

【问题讨论】:

    标签: android


    【解决方案1】:

    尝试运行 android 工具并安装以下项目:

    打开 SDK 管理器。

    You will require:
    1. "SDK Platform" for android-23
    2. "Android SDK Platform-tools (latest)
    3. "Android SDK Build-tools" (latest)]
    

    【讨论】:

    • 我已经设置了所有这些并为这些项目设置了环境变量路径。但仍然面临问题。为 Android 构建时存在问题,而 ionic serve 和 ionic build bwoser 工作正常。跨度>
    • 你的安卓 SDK Api 23 ?或将您在 cmd 中遇到的错误发送给我。
    • 是的,我有 SDK“android-23”。 BUILD FAILED C:\Program Files\Android\Sdk\tools\ant\build.xml:716:执行此行时出现以下错误:C:\Program Files\Android\Sdk\tools\ant\build.xml: 730:编译失败;有关详细信息,请参阅编译器错误输出。总时间:2秒 F:\Verifast\Ionic\Teller\src\platforms\android\cordova\node_modules\q\q.js:126 throw e; ^ 命令的错误代码 1: cmd with args: /s,/c,ant,debug,-f,F:\todo\Ionic\Te ller\src\platforms\android\build.xml,-Dout.dir=ant -build,-Dgen.absolute.dir=ant- gen –
    • 好的,你安装了 apache ant 并在环境变量中设置了那个路径吗?
    【解决方案2】:

    cordova 平台更新 android

    将修复错误。 Cordova 总是落后于 android 版本,例如,如果我们有 android API 24,那么我们有 cordova 5.x.x 支持高达 API 23 。因此,任何使用 API 24 构建的项目(例如,使用 Android Studio)都会显示此错误。

    为了更好地理解,我发布了我得到的错误:

    错误:cmd:命令失败,退出代码 1 错误输出: FAILURE:构建失败并出现异常。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-11-06
      • 1970-01-01
      • 2021-09-04
      • 1970-01-01
      • 2018-08-21
      • 2012-05-15
      相关资源
      最近更新 更多