Cordova 8.0.0 dont build any platform (with Ionic)

When I type

ionic cordova platform add ios --prod

or

ionic cordova platform add android --prod

It says “Done!” but I don’t see anything on C:\Users\username\projectname\platforms.

Cordova version: 8.0.0

Ionic version: 3.9.2

What is your ionic info output?
Can you post the complete output of the command you are running?

In general: --prod is a option of the ionic cordova build android/ios command, not of platform add.

Hi, ionic info there

cli packages: (C:\Users\tensor\AppData\Roaming\npm\node_modules)

@ionic/cli-utils  : 1.9.2
ionic (Ionic CLI) : 3.9.2

global packages:

Cordova CLI : 8.0.0

local packages:

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

System:

Node : v8.11.3
npm  : 6.4.0
OS   : Windows 8.1

Both of them (–prod --save) gives same output.
ionic cordova platform add android --save
Running command - done!

--save is also not an option of the command you should be using.

  1. ionic cordova platform add android
  2. ionic cordova build android

If 1) fails, please post the complete output.

1 not fails. Says “Running command - done!”, but I can’t see any platform in /platforms.

That is not what it should say. It should be more like this:

λ ionic cordova platform add android
> cordova platform add android --save
Using cordova-fetch for cordova-android@~7.0.0
Adding android project...
Creating Cordova project for the Android platform:
        Path: platforms\android
        Package: io.ionic.starter
        Name: MausGeschichten
        Activity: MainActivity
        Android target: android-26
Subproject Path: CordovaLib
Subproject Path: app
Android project created with cordova-android@7.0.0
Android Studio project detected
Android Studio project detected
Discovered plugin "cordova-plugin-whitelist" in config.xml. Adding it to the project
Installing "cordova-plugin-whitelist" for android

               This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.

Adding cordova-plugin-whitelist to package.json
Saved plugin info for "cordova-plugin-whitelist" to config.xml
Discovered plugin "cordova-plugin-device" in config.xml. Adding it to the project
Installing "cordova-plugin-device" for android
Adding cordova-plugin-device to package.json
Saved plugin info for "cordova-plugin-device" to config.xml
Discovered plugin "cordova-plugin-splashscreen" in config.xml. Adding it to the project
Installing "cordova-plugin-splashscreen" for android
Adding cordova-plugin-splashscreen to package.json
Saved plugin info for "cordova-plugin-splashscreen" to config.xml
Discovered plugin "cordova-plugin-ionic-webview" in config.xml. Adding it to the project
Installing "cordova-plugin-ionic-webview" for android
Adding cordova-plugin-ionic-webview to package.json
Saved plugin info for "cordova-plugin-ionic-webview" to config.xml
Discovered plugin "cordova-plugin-ionic-keyboard" in config.xml. Adding it to the project
Installing "cordova-plugin-ionic-keyboard" for android
Adding cordova-plugin-ionic-keyboard to package.json
Saved plugin info for "cordova-plugin-ionic-keyboard" to config.xml
--save flag or autosave detected
Saving android@~7.0.0 into config.xml file ...


:frowning:

Hey, I found something, is there a connection?

npm list

Run ionic cordova platform add android --verbose please.

Your second screenshot just shows that everything is very broken. What does npm list -g --depth=0 return?

1 Like

This.

+-- cordova@6.5.0
+-- cordova-android@7.1.1
+-- firebase-tools@4.2.0
`-- ionic@3.14.0

This is super old and should be updated: npm install -g cordova

This should not be installed globally: npm unintstall -g cordova-android

This is pretty old as well, update: npm install -g ionic.

Please also answer my other question.

Hi, works fine now. But says

[WARN] Detected locally installed Ionic CLI, but it’s too old–using global CLI.

You can get rid of that by running npm uninstall ionic in your project.

Hi, thanks a lot for solving.

1 Like