Reputation: 21
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
but when I run ionic build android The build fails.
BUILD FAILED
Total time: 29.551 secs FAILURE: Build failed with an exception.
What went wrong: A problem occurred configuring root project 'android'.
java.lang.NullPointerException (no error message)
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.
What went wrong: A problem occurred configuring root project 'android'.
java.lang.NullPointerException (no error message)
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Upvotes: 2
Views: 2867
Reputation: 59
Just remove the node_modules folder from your project using:
rm -rf node_modules
and then install all dependencies again:
npm i
Upvotes: 0
Reputation: 21
This worked for me.Just needed to set the environment variable(ANDROID_HOME & PATH) in the CLI
Upvotes: 0
Reputation: 7359
I have faced the same issue and Solved... What you need to do is
first Solution
ionic platform rm android ,
ionic platform add android ,
If that does not work then
Second
Solved my problem
Upvotes: 0