Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot Build : Metadata version mismatch for module , found version 4, expected 3 #15324

Closed
kochraph opened this issue Aug 24, 2018 · 9 comments

Comments

Projects
None yet
4 participants
@kochraph
Copy link

commented Aug 24, 2018

Bug Report

Ionic Info
Run ionic info from a terminal/cmd prompt and paste the output below.

✔ Gathering environment info - done!

Ionic:

   ionic (Ionic CLI)  : 4.1.1
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.1.11

Cordova:

   cordova (Cordova CLI) : 7.1.0
   Cordova Platforms     : android 6.3.0, browser 5.0.3, ios 4.5.5
   Cordova Plugins       : no whitelisted plugins (15 plugins total)

System:

   Android SDK Tools : 26.1.1 (/Users/raphaelkoch/Library/Android/sdk/)
   ios-deploy        : 1.9.2
   NodeJS            : v6.11.1 (/usr/local/bin/node)
   npm               : 5.4.2
   OS                : macOS Sierra
   Xcode             : Xcode 9.2 Build version 9C40b

Describe the Bug
While executing :

ionic cordova build ios --prod --release"

I get the following error 👍

[17:07:52]  ionic-app-script task: "build" 
[17:07:52]  Error: Metadata version mismatch for module 
            /Users/raphaelkoch/Documents/Ionic_Source/node_modules/@ionic-native/core/decorators.d.ts, found version 4, 
            expected 3 
Error: Metadata version mismatch for module /Users/raphaelkoch/Documents/Ionic_Source/node_modules/@ionic-native/core/decorators.d.ts, found version 4, expected 3
    at StaticSymbolResolver.getModuleMetadata (/Users/raphaelkoch/Documents/Ionic_Source/node_modules/@angular/compiler/bundles/compiler.umd.js:25616:34)
    at StaticSymbolResolver._createSymbolsOf (/Users/raphaelkoch/Documents/Ionic_Source/node_modules/@angular/compiler/bundles/compiler.umd.js:25404:46)
    at StaticSymbolResolver.getSymbolsOf (/Users/raphaelkoch/Documents/Ionic_Source/node_modules/@angular/compiler/bundles/compiler.umd.js:25385:14)
    at /Users/raphaelkoch/Documents/Ionic_Source/node_modules/@angular/compiler/bundles/compiler.umd.js:24241:30
    at Array.forEach (native)
    at extractProgramSymbols (/Users/raphaelkoch/Documents/Ionic_Source/node_modules/@angular/compiler/bundles/compiler.umd.js:24240:79)
    at AotCompiler.analyzeModulesAsync (/Users/raphaelkoch/Documents/Ionic_Source/node_modules/@angular/compiler/bundles/compiler.umd.js:23796:47)
    at CodeGenerator.codegen (/Users/raphaelkoch/Documents/Ionic_Source/node_modules/@angular/compiler-cli/src/codegen.js:32:14)
    at Function.NgTools_InternalApi_NG_2.codeGen (/Users/raphaelkoch/Documents/Ionic_Source/node_modules/@angular/compiler-cli/src/ngtools_api.js:73:30)
    at /Users/raphaelkoch/Documents/Ionic_Source/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:182:73
[ERROR] An error occurred while running subprocess ionic-app-scripts.
        
        ionic-app-scripts build --prod --target cordova --platform ios exited with exit code 1.
        
        Re-running this command with the --verbose flag may provide more information.

Steps to Reproduce
Steps to reproduce the behavior:

  1. ionic cordova build ios --prod --release
    I have the same issue for android
    if I remove the --prod, I can compile without any issue

Related Code
Build IOS,
Expected Behavior
A clear and concise description of what you expected to happen.

@ionitron-bot ionitron-bot bot added the triage label Aug 24, 2018

@kochraph

This comment has been minimized.

Copy link
Author

commented Aug 24, 2018

If needed (package.json)

"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.4.3",
"@angular/compiler": "^4.4.3",
"@angular/compiler-cli": "^4.4.3",
"@angular/core": "^4.4.3",
"@angular/forms": "^4.4.3",
"@angular/http": "^4.4.3",
"@angular/platform-browser": "^4.4.3",
"@angular/platform-browser-dynamic": "^4.4.3",
"@angular/tsc-wrapped": "^4.4.7",
"@ionic-native/android-permissions": "^4.5.2",
"@ionic-native/camera": "^4.7.0",
"@ionic-native/core": "^4.4.2",
"@ionic-native/device": "^4.12.0",
"@ionic-native/file": "^4.7.0",
"@ionic-native/file-path": "^4.7.0",
"@ionic-native/file-transfer": "^4.7.0",
"@ionic-native/geolocation": "^4.4.2",
"@ionic-native/google-maps": "^4.4.2",
"@ionic-native/keyboard": "^4.5.0",
"@ionic-native/network": "^4.4.2",
"@ionic-native/photo-viewer": "^4.7.0",
"@ionic-native/social-sharing": "^4.4.2",
"@ionic-native/splash-screen": "^4.4.2",
"@ionic-native/status-bar": "^4.4.2",
"@ionic/storage": "2.0.1",
"ajv": "^5.3.0",
"balanced-match": "^1.0.0",
"big-integer": "^1.6.26",
"brace-expansion": "^1.1.8",
"cordova-android": "6.3.0",
"cordova-android-support-gradle-release": "^1.4.2",
"cordova-browser": "5.0.3",
"cordova-common": "^2.1.0",
"cordova-ios": "4.5.5",
"cordova-plugin-android-permissions": "^1.0.0",
"cordova-plugin-camera": "^4.0.3",
"cordova-plugin-compat": "^1.2.0",
"cordova-plugin-device": "^2.0.2",
"cordova-plugin-file": "^6.0.1",
"cordova-plugin-filepath": "^1.3.0",
"cordova-plugin-geolocation": "^2.4.3",
"cordova-plugin-googlemaps": "^2.1.1",
"cordova-plugin-googlemaps-sdk": "git+https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk.git",
"cordova-plugin-splashscreen": "^4.1.0",
"cordova-plugin-statusbar": "^2.3.0",
"cordova-plugin-whitelist": "^1.3.3",
"cordova-plugin-x-socialsharing": "^5.2.1",
"cordova-serve": "^2.0.0",
"cordova-sqlite-storage": "^2.1.4",
"es6-promise-plugin": "^4.1.0",
"ionic-angular": "^3.9.2",
"ionic-plugin-keyboard": "^2.2.1",
"ionicons": "3.0.0",
"localforage": "^1.5.5",
"localforage-cordovasqlitedriver": "^1.6.0",
"mime-types": "^2.1.17",
"parseurl": "^1.3.2",
"rollup": "^0.50.1",
"rxjs": "^5.5.2",
"sw-toolbox": "3.6.0",
"uglify-js": "^3.1.9",
"zone.js": "^0.8.18"
},
"devDependencies": {
"@ionic/app-scripts": "3.1.11",
"ionic": "4.1.1",
"typescript": "^2.6.1"
},

@ademir10

This comment has been minimized.

Copy link

commented Aug 25, 2018

I'm with the same problem here! any suggestion guys?

ionic-app-script task: "build"
[11:16:19] Error: Metadata version mismatch for module
/Users/dede/ionic/getapp/node_modules/@ionic-native/barcode-scanner/index.d.ts, found version 4, expected 3

Ionic:

ionic (Ionic CLI) : 4.1.1
Ionic Framework : ionic-angular 3.5.0
@ionic/app-scripts : 1.3.12

Cordova:

cordova (Cordova CLI) : 8.0.0
Cordova Platforms : ios 4.5.5
Cordova Plugins : cordova-plugin-ionic-webview 1.2.1, (and 19 other plugins)

System:

Android SDK Tools : 26.1.1 (/Users/dede/Library/Android/sdk)
NodeJS : v9.11.1 (/usr/local/bin/node)
npm : 5.6.0
OS : macOS High Sierra

@ademir10

This comment has been minimized.

Copy link

commented Aug 25, 2018

did you find some solution kochraph? thanks dude!

@SylvioMigliorucci

This comment has been minimized.

Copy link

commented Aug 28, 2018

Apparently you can use the 'cordova build android --prod --release' command, but you can not install the apk for testing.

@kochraph

This comment has been minimized.

Copy link
Author

commented Aug 29, 2018

It appears that I was running late version inside the package json, here is my new version. I also had to 'npm install' all the newest packages before I could build again !

"dependencies":

{
"@angular/common": "5.2.11",
"@angular/compiler": "5.2.11",
"@angular/compiler-cli": "5.2.11",
"@angular/core": "5.2.11",
"@angular/forms": "5.2.11",
"@angular/http": "5.2.11",
"@angular/platform-browser": "5.2.11",
"@angular/platform-browser-dynamic": "5.2.11",
"@angular/tsc-wrapped": "4.4.7",
"@ionic-native/android-permissions": "~4.11.0",
"@ionic-native/camera": "~4.11.0",
"@ionic-native/core": "~4.11.0",
"@ionic-native/device": "~4.11.0",
"@ionic-native/file": "~4.11.0",
"@ionic-native/file-path": "~4.11.0",
"@ionic-native/file-transfer": "~4.11.0",
"@ionic-native/geolocation": "~4.11.0",
"@ionic-native/google-maps": "^4.9.1",
"@ionic-native/keyboard": "~4.11.0",
"@ionic-native/network": "~4.11.0",
"@ionic-native/photo-viewer": "~4.11.0",
"@ionic-native/social-sharing": "~4.11.0",
"@ionic-native/splash-screen": "~4.11.0",
"@ionic-native/status-bar": "~4.11.0",
"@ionic/storage": "2.1.3",
"ajv": "^5.3.0",
"balanced-match": "^1.0.0",
"big-integer": "^1.6.26",
"brace-expansion": "^1.1.8",
"cordova-android": "6.3.0",
"cordova-android-support-gradle-release": "^1.4.4",
"cordova-browser": "5.0.4",
"cordova-common": "^2.1.0",
"cordova-ios": "4.5.5",
"cordova-plugin-android-permissions": "^1.0.0",
"cordova-plugin-camera": "^4.0.3",
"cordova-plugin-compat": "^1.2.0",
"cordova-plugin-device": "^2.0.2",
"cordova-plugin-file": "^6.0.1",
"cordova-plugin-filepath": "^1.4.2",
"cordova-plugin-geolocation": "^2.4.3",
"cordova-plugin-googlemaps": "^2.1.1",
"cordova-plugin-googlemaps-sdk": "git+https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk.git",
"cordova-plugin-splashscreen": "^4.1.0",
"cordova-plugin-statusbar": "^2.3.0",
"cordova-plugin-whitelist": "^1.3.3",
"cordova-plugin-x-socialsharing": "^5.2.1",
"cordova-serve": "^2.0.0",
"cordova-sqlite-storage": "^2.1.4",
"es6-promise-plugin": "^4.1.0",
"ionic-angular": "^3.9.2",
"ionic-plugin-keyboard": "^2.2.1",
"ionicons": "3.0.0",
"localforage": "^1.5.5",
"localforage-cordovasqlitedriver": "^1.6.0",
"mime-types": "^2.1.17",
"parseurl": "^1.3.2",
"rollup": "^0.50.1",
"rxjs": "^5.5.2",
"sw-toolbox": "3.6.0",
"uglify-js": "^3.1.9",
"zone.js": "^0.8.18"
},
"devDependencies": {
"@ionic/app-scripts": "3.2.0",
"ionic": "4.1.1",
"typescript": "~2.6.2"
},

hope that this is helping you...

@kochraph

This comment has been minimized.

Copy link
Author

commented Aug 31, 2018

for me this is resolved now.

@kochraph kochraph closed this Aug 31, 2018

@raelmiu

This comment has been minimized.

Copy link

commented Sep 3, 2018

I have this problem as well. NPM install/update did not solve.

@raelmiu

This comment has been minimized.

Copy link

commented Sep 3, 2018

I copied all the @angular and @Ionic, as well as typescript, versions from @kochraph's package.json above. That worked for me.

@ionitron-bot

This comment has been minimized.

Copy link

commented Oct 3, 2018

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Oct 3, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.