Accepted answer

For posterity: usually the solution is to make sure there's a www/ directory inside the root directory.

  • Has a .cordova directory, with a config.json inside.
  • Has a www directory, with a config.xml inside.
  • Has a platforms directory.

If all is well then update your cordova

npm install -g cordova

got the same error in my android project, this is how I solved it:

  1. Create new cordova project cordova create app
  2. add android platform by cordova platform add android
  3. Copy the full application folder that we are using in the newly created project/platform folder
  4. Copy the all cordova files from platform/android folder to the application folder
  5. Delete the android folder
  6. Rename the application folder to android
  7. import the android folder in android studio
  8. Build and run the project

 having the same issue after cloning an existing project down to a machine. Attempted to uninstall/reinstall ionic/phonegap/cordova without success. Also attempted the cordova create . command without any luck.

having the same problem. tried updating cordova. ran “cordova create .” from another thread. nothing seems to fix this. any updates?

just use 'cordova plugin add cordova-pdf-generator’, instead use ‘ionic cordova plugin add cordova-pdf-generator’