Can't use ionic cordova build ios --prod --release with Barcode Scanner plugin installed


#1

I am using Ionic version 4.3.1. When I try to use ionic cordova build ios --prod --release with the Barcode Scanner plugin installed, I get this error:

[10:25:59] ionic-app-script task: “build”
[10:25:59] Error: Metadata version mismatch for module
/Users/waynedocuwrx/Desktop/Apps/DCF_Document_Direct/node_modules/@ionic-native/barcode-scanner/index.d.ts,
found version 4, expected 3
Error: Metadata version mismatch for module /Users/waynedocuwrx/Desktop/Apps/DCF_Document_Direct/node_modules/@ionic-native/barcode-scanner/index.d.ts, found version 4, expected 3
at StaticSymbolResolver.getModuleMetadata (/Users/waynedocuwrx/Desktop/Apps/DCF_Document_Direct/node_modules/@angular/compiler/bundles/compiler.umd.js:25755:34)
at StaticSymbolResolver._createSymbolsOf (/Users/waynedocuwrx/Desktop/Apps/DCF_Document_Direct/node_modules/@angular/compiler/bundles/compiler.umd.js:25543:46)
at StaticSymbolResolver.getSymbolsOf (/Users/waynedocuwrx/Desktop/Apps/DCF_Document_Direct/node_modules/@angular/compiler/bundles/compiler.umd.js:25524:14)
at /Users/waynedocuwrx/Desktop/Apps/DCF_Document_Direct/node_modules/@angular/compiler/bundles/compiler.umd.js:24381:30
at Array.forEach ()
at extractProgramSymbols (/Users/waynedocuwrx/Desktop/Apps/DCF_Document_Direct/node_modules/@angular/compiler/bundles/compiler.umd.js:24380:79)
at AotCompiler.analyzeModulesAsync (/Users/waynedocuwrx/Desktop/Apps/DCF_Document_Direct/node_modules/@angular/compiler/bundles/compiler.umd.js:23936:47)
at CodeGenerator.codegen (/Users/waynedocuwrx/Desktop/Apps/DCF_Document_Direct/node_modules/@angular/compiler-cli/src/codegen.js:32:14)
at Function.NgTools_InternalApi_NG_2.codeGen (/Users/waynedocuwrx/Desktop/Apps/DCF_Document_Direct/node_modules/@angular/compiler-cli/src/ngtools_api.js:73:30)
at Object.doCodegen (/Users/waynedocuwrx/Desktop/Apps/DCF_Document_Direct/node_modules/@ionic/app-scripts/dist/aot/codegen.js:6:51)
[ERROR] An error occurred while running subprocess ionic-app-scripts.