失败:构建失败,异常出现问题,配置根项目'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
- ionic start todo blank
- cd todo
- 离子平台添加android
但是当我运行
离子生成android
构建失败。
but when I run ionic build android The build fails.
BUILD FAILED
BUILD FAILED
总时间: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错误输出:
FAILURE:构建失败并出现异常。
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