New Ionic 5 project - livereload Cordova does not work

I create a brand new angular based Ionic 5 project.

I then added the cordova android platform with the following command:

ionic cordova platform add android

I run the following command to do a livereload:

ionic cordova run android -l

I get the following error:

ionic cordova run android -l
[INFO] Hardware device(s) found for android. Using --device.
> ng run app:ionic-cordova-serve --host=localhost --port=8100 --platform=android
[ng] An unhandled exception occurred: Invalid options object. Copy Plugin has been initialized using an options object that does not match the API schema.
[ng]  - options[0] misses the property 'patterns'. Should be:
[ng]    [non-empty string | object { from, to?, context?, globOptions?, toType?, force?, flatten?, transform?, cacheTransform?, transformPath?, noErrorOnMissing? }, ...] (should not have fewer than 1 item)
[ng] See "/private/var/folders/1k/dwr2csfs5lnfrs7xq7520v_w0000gq/T/ng-K8HjCr/angular-errors.log" for further details.

[ERROR] ng has unexpectedly closed (exit code 127).
        
        The Ionic CLI will exit. Please check any output above for error details.

The error references another error log file. The contents are as follows:

[error] ValidationError: Invalid options object. Copy Plugin has been initialized using an options object that does not match the API schema.
 - options[0] misses the property 'patterns'. Should be:
   [non-empty string | object { from, to?, context?, globOptions?, toType?, force?, flatten?, transform?, cacheTransform?, transformPath?, noErrorOnMissing? }, ...] (should not have fewer than 1 item)
    at validate (/Users/b/ionic5_apps/tests/test2/node_modules/schema-utils/dist/validate.js:96:11)
    at new CopyPlugin (/Users/b/ionic5_apps/tests/test2/node_modules/copy-webpack-plugin/dist/index.js:24:30)
    at Object.webpackConfiguration (/Users/b/ionic5_apps/tests/test2/node_modules/@ionic/angular-toolkit/builders/cordova-serve/index.js:55:39)
    at setup (/Users/b/ionic5_apps/tests/test2/node_modules/@angular-devkit/build-angular/src/dev-server/index.js:88:46)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

I created a repository with the new project:

Is anyone else seeing this?

Can someone try the repo I created to see if they also see the issue?

My Ionic Info is

Ionic:

   Ionic CLI                     : 6.11.0 (/Users/brentw/.nvm/versions/node/v12.18.3/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 5.3.1
   @angular-devkit/build-angular : 0.1000.6
   @angular-devkit/schematics    : 10.0.6
   @angular/cli                  : 10.0.6
   @ionic/angular-toolkit        : 2.3.1

Cordova:

   Cordova CLI       : 10.0.0
   Cordova Platforms : android 9.0.0
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.1, (and 4 other plugins)

Utility:

   cordova-res : 0.15.1
   native-run  : 1.0.0

System:

   NodeJS : v12.18.3 (/Users/b/.nvm/versions/node/v12.18.3/bin/node)
   npm    : 6.14.6
   OS     : macOS Catalina
   Xcode  : Xcode 11.3.1 Build version 11C504

UPDATE:
I posted an issue at:

See this. https://github.com/ionic-team/ionic-cli/issues/4519

npm i @ionic/angular-toolkit@2.3.0 -E -D

1 Like