Ajay Gupta
Ajay Gupta

Reputation: 21

Failure: build failed with an exception a problem occured configuring root project 'android'

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 blank
  2. cd todo
  3. ionic platform add android

but when I run ionic build android The build fails.

BUILD FAILED

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

Upvotes: 2

Views: 2867

Answers (3)

Gabriel Felipe
Gabriel Felipe

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

Ajay Gupta
Ajay Gupta

Reputation: 21

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

Upvotes: 0

Gopinath Kaliappan
Gopinath Kaliappan

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

    • Remove your all plugins and add again ,

Solved my problem

Upvotes: 0

Related Questions