Angular 4, angularfire2, Metadata version mismatch


#1

Im getting the following error trying to create an apk

ionic cordova run android --prod

Metadata version mismatch for module ../node_modules/angularfire2/index.d.ts, found version 4, expected 3,

Here is my package.json

{
    "name": "Bizo",
    "version": "0.0.1",
    "author": "Ionic Framework",
    "homepage": "http://ionicframework.com/",
    "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",
        "@angular/router": "^4.1.3",
        "@ionic-native/contacts": "^4.3.1",
        "@ionic-native/core": "^4.4.2",
        "@ionic-native/device": "^4.3.1",
        "@ionic-native/facebook": "^4.4.2",
        "@ionic-native/globalization": "^4.4.2",
        "@ionic-native/keyboard": "^4.4.2",
        "@ionic-native/splash-screen": "3.12.1",
        "@ionic-native/status-bar": "3.12.1",
        "@ionic/storage": "2.0.1",
        "@ngx-translate/core": "^8.0.0",
        "@ngx-translate/http-loader": "^0.1.0",
        "angular2-signaturepad": "^2.6.1",
        "copyfiles": "^1.2.0",
        "cordova-android": "6.4.0",
        "cordova-custom-config": "^4.0.2",
        "cordova-ios": "^4.5.4",
        "cordova-plugin-compat": "^1.2.0",
        "cordova-plugin-contacts": "^2.3.1",
        "cordova-plugin-device": "^1.1.4",
        "cordova-plugin-facebook4": "^1.9.1",
        "cordova-plugin-globalization": "^1.0.8",
        "cordova-plugin-inapppurchase": "^1.2.0",
        "cordova-plugin-splashscreen": "^4.0.3",
        "cordova-plugin-statusbar": "^2.2.2",
        "cordova-plugin-whitelist": "^1.3.1",
        "core-js": "^2.4.1",
        "d3": "^4.11.0",
        "ionic": "^3.13.2",
        "ionic-angular": "3.7.1",
        "ionic-plugin-keyboard": "^2.2.1",
        "ionicons": "3.0.0",
        "lodash": "^4.17.4",
        "moment": "^2.19.1",
        "rxjs": "^5.5.0",
        "sw-toolbox": "3.6.0",
        "zone.js": "0.8.12"
    },
    "devDependencies": {
        "@ionic/app-scripts": "2.1.4",
        "@types/c3": "^0.4.44",
        "@types/d3": "4.10.1",
        "@types/jasmine": "^2.6.0",
        "angularfire2": "^5.0.0-rc.3",
        "firebase": "^4.7.0",
        "jasmine-core": "^2.8.0",
        "json-loader": "^0.5.7",
        "karma": "^1.7.1",
        "karma-chrome-launcher": "^2.2.0",
        "karma-jasmine": "^1.1.0",
        "typescript": "2.3.4"
    },
    "description": "An Ionic project",
    "cordova": {
        "plugins": {
            "cordova-plugin-device": {},
            "cordova-plugin-splashscreen": {},
            "cordova-plugin-statusbar": {},
            "cordova-plugin-whitelist": {},
            "ionic-plugin-keyboard": {},
            "cordova-plugin-contacts": {},
            "cordova-plugin-globalization": {},
            "cordova-plugin-facebook4": {
                "APP_ID": "1352766108174189",
                "APP_NAME": "bizo"
            }
        },
        "platforms": [
            "android",
            "ios"
        ]
    }
}

I have tried the following:

updating angularfire to its latest version:
npm install angularfire2 firebase promise-polyfill --save

Tried downgrading angularfire2 to ver 5.0.0-rc.0 / 5.0.0-rc.2
Tried updating and downgrading firebase to 4.6.0 and to 4.8.0

Nothing helped


#2

I have the same problem. Anyone can help?