Cordova build android --prod error


I tried to build my application to android using command prompt and this showed up:

Anybody know what the issue is??


Does ionic build --prod work?
What is your ionic info output?


@Sujan12 ionic build --prod same result as above…
when ionic info command was run :
cli packages: (C:\Users\USER\AppData\Roaming\npm\node_modules)

@ionic/cli-utils  : 1.19.0
ionic (Ionic CLI) : 3.19.0

global packages:

cordova (Cordova CLI) : not installed

local packages:

@ionic/app-scripts : 3.1.2
Cordova Platforms  : none
Ionic Framework    : ionic-angular 3.9.2


Node : v8.9.1
npm  : 5.5.1
OS   : Windows 10

Environment Variables:

ANDROID_HOME : not set


backend : pro


That’s good as it shows Cordova is not involved in your problem.

Create a new project with ionic start and see if ionic build --prod works there for you. If yes, compare the files the error message mentions to see what is different in your “old” project.


@Sujan12 I created a new project new_test and tried to add platform android to it and it shows error:

when I tried to add platform in my existing project I was succeeded and when I try to run ’ ionic build --prod’ It shows error:

I tried both the commands while I’m in administrator mode…please help!!


That should not be necessary.

Note that your first screenshot shows a cordova command. You are posting in the Ionic forum. Ionic commands start with ionic, sometimes they then go on to become ionic cordova. The difference matters.

Why did you first remove the platform in your new_test project? This should not be necessary or even possible with a really new project. I am not sure I can trust what you write.