失败:构建失败,出现异常,配置根项目"android"时出现问题 [英] Failure: build failed with an exception a problem occured configuring root project 'android'

查看:130
本文介绍了失败:构建失败,出现异常,配置根项目"android"时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用离子框架构建一个混合应用程序. 我确实安装了npm,cordova,ionic和android sdk. 我也设置了环境变量. 我能够运行以下命令

I'm building a hybrid app using ionic framework. I did installed npm,cordova, ionic and android sdk. also I have set the environment variables. I was able to run following commands

  1. ionic start todo空白
  2. cd待办事项
  3. ionic平台添加android

但是当我跑步时 离子构建Android 构建失败.

but when I run ionic build android The build fails.

建立失败

总时间:29.551秒 失败:构建失败,并出现异常.

Total time: 29.551 secs FAILURE: Build failed with an exception.

  • 出了什么问题: 配置根项目"android"时出现问题.

  • What went wrong: A problem occurred configuring root project 'android'.

java.lang.NullPointerException(无错误消息)

java.lang.NullPointerException (no error message)

  • 尝试: 使用--stacktrace选项运行以获取堆栈跟踪.使用--info或--debug选项运行,以获取更多日志输出. 错误:cmd:命令失败,退出代码为1错误输出: 失败:构建因异常而失败.

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Error: cmd: Command failed with exit code 1 Error output: FAILURE: Build failed with an exception.

    出了什么问题: 配置根项目"android"时出现问题.

    What went wrong: A problem occurred configuring root project 'android'.

    java.lang.NullPointerException(无错误消息)

    java.lang.NullPointerException (no error message)

  • 尝试: 使用--stacktrace选项运行以获取堆栈跟踪.使用--info或--debug选项运行,以获取更多日志输出.

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

    推荐答案

    这对我有用.只需在CLI中设置环境变量(ANDROID_HOME& PATH)

    This worked for me.Just needed to set the environment variable(ANDROID_HOME & PATH) in the CLI

    这篇关于失败:构建失败,出现异常,配置根项目"android"时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆