Not able to build the app with cordova


#1

I try to build the application using the following command

ionic cordova build android --prod --release

But it fails like this

[15:39:05]  ionic-app-script task: "build" 
[15:39:05]  Error: Metadata version mismatch for module 
            /home/nifras/Documents/Projects/TechOrin/tamilpicbook/node_modules/@ionic-native/file/index.d.ts, found 
            version 4, expected 3 
Error: Metadata version mismatch for module /home/nifras/Documents/Projects/TechOrin/tamilpicbook/node_modules/@ionic-native/file/index.d.ts, found version 4, expected 3
    at StaticSymbolResolver.getModuleMetadata (/home/nifras/Documents/Projects/TechOrin/tamilpicbook/node_modules/@angular/compiler/bundles/compiler.umd.js:24474:34)
    at StaticSymbolResolver._createSymbolsOf (/home/nifras/Documents/Projects/TechOrin/tamilpicbook/node_modules/@angular/compiler/bundles/compiler.umd.js:24260:46)
    at StaticSymbolResolver.getSymbolsOf (/home/nifras/Documents/Projects/TechOrin/tamilpicbook/node_modules/@angular/compiler/bundles/compiler.umd.js:24241:14)
    at /home/nifras/Documents/Projects/TechOrin/tamilpicbook/node_modules/@angular/compiler/bundles/compiler.umd.js:23023:30
    at Array.forEach (<anonymous>)
    at extractProgramSymbols (/home/nifras/Documents/Projects/TechOrin/tamilpicbook/node_modules/@angular/compiler/bundles/compiler.umd.js:23022:79)
    at AotCompiler.compileAll (/home/nifras/Documents/Projects/TechOrin/tamilpicbook/node_modules/@angular/compiler/bundles/compiler.umd.js:22720:47)
    at CodeGenerator.codegen (/home/nifras/Documents/Projects/TechOrin/tamilpicbook/node_modules/@angular/compiler-cli/src/codegen.js:30:14)
    at Function.NgTools_InternalApi_NG_2.codeGen (/home/nifras/Documents/Projects/TechOrin/tamilpicbook/node_modules/@angular/compiler-cli/src/ngtools_api.js:61:30)
    at Object.doCodegen (/home/nifras/Documents/Projects/TechOrin/tamilpicbook/node_modules/@ionic/app-scripts/dist/aot/codegen.js:6:51)
[ERROR] An error occurred while running subprocess ionic-app-scripts.
        
        ionic-app-scripts build --prod --target cordova --platform android 
        exited with exit code 1.
        
        Re-running this command with the --verbose flag may provide more 
        information.

I understand this is the version issue. I change all the version stuffs not work for now.

my package.json is as follow

{
  "name": "tamil-picture-books",
  "version": "0.00.13",
  "author": "Tamil Graded Readers",
  "homepage": "http://tamilpicturebooks.org",
  "private": true,
  "scripts": {
    "clean": "ionic-app-scripts clean",
    "build": "ionic-app-scripts build",
    "lint": "ionic-app-scripts lint",
    "ionic:build": "ionic-app-scripts build",
    "ionic:serve": "ionic-app-scripts serve"
  },
  "dependencies": {
    "@angular/common": "4.1.3",
    "@angular/compiler": "4.1.3",
    "@angular/compiler-cli": "4.1.3",
    "@angular/core": "4.1.3",
    "@angular/forms": "4.1.3",
    "@angular/http": "4.1.3",
    "@angular/platform-browser": "4.1.3",
    "@angular/platform-browser-dynamic": "4.1.3",
    "@ionic-native/app-minimize": "4.17.0",
    "@ionic-native/camera": "4.17.0",
    "@ionic-native/core": "4.17.0",
    "@ionic-native/device": "4.17.0",
    "@ionic-native/file": "4.17.0",
    "@ionic-native/file-path": "4.17.0",
    "@ionic-native/file-transfer": "^4.7.0",
    "@ionic-native/keyboard": "4.17.0",
    "@ionic-native/splash-screen": "4.17.0",
    "@ionic-native/sqlite": "4.17.0",
    "@ionic-native/status-bar": "4.17.0",
    "@ionic-native/toast": "4.17.0",
    "@ionic-native/transfer": "4.17.0",
    "@ionic/storage": "^2.0.1",
    "cordova-android": "^6.4.0",
    "cordova-plugin-appminimize": "^1.0.0",
    "cordova-plugin-camera": "^4.0.2",
    "cordova-plugin-console": "^1.1.0",
    "cordova-plugin-device": "^1.1.7",
    "cordova-plugin-file": "^6.0.1",
    "cordova-plugin-file-transfer": "^1.7.1",
    "cordova-plugin-filepath": "^1.2.0",
    "cordova-plugin-splashscreen": "^4.1.0",
    "cordova-plugin-statusbar": "^2.4.1",
    "cordova-plugin-whitelist": "^1.3.3",
    "cordova-plugin-x-toast": "^2.6.2",
    "cordova-sqlite-storage": "^2.3.0",
    "font-awesome": "^4.7.0",
    "imgcache.js": "^1.1.1",
    "ionic-angular": "3.5.0",
    "ionic-cache": "^2.1.0",
    "ionic-image-loader": "^4.2.1",
    "ionic-img-viewer": "^2.9.0",
    "ionic-plugin-keyboard": "^2.2.1",
    "ionicons": "3.0.0",
    "rxjs": "5.5.0",
    "sw-toolbox": "3.6.0",
    "zone.js": "0.8.12"
  },
  "devDependencies": {
    "@ionic/app-scripts": "1.3.12",
    "tslint-ionic-rules": "0.0.14",
    "typescript": "2.3.4"
  },
  "config": {
    "ionic_copy": "./scripts/copy-custom-libs.js"
  },
  "cordovaPlugins": [
    "cordova-plugin-whitelist",
    "cordova-plugin-console",
    "cordova-plugin-statusbar",
    "cordova-plugin-device",
    "cordova-plugin-splashscreen"
  ],
  "cordovaPlatforms": [],
  "description": "Tamil Picture Books 4 Kids",
  "cordova": {
    "plugins": {
      "cordova-sqlite-storage": {},
      "cordova-plugin-whitelist": {},
      "cordova-plugin-statusbar": {},
      "cordova-plugin-device": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-x-toast": {},
      "cordova-plugin-camera": {},
      "cordova-plugin-file": {},
      "cordova-plugin-file-transfer": {},
      "cordova-plugin-filepath": {},
      "cordova-plugin-console": {},
      "cordova-plugin-appminimize": {},
      "ionic-plugin-keyboard": {}
    },
    "platforms": [
      "android"
    ]
  }
}