Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error while running ionic ios build --prod --release

After installing Themeable browser plugin I am getting this error when I run :

ionic cordova build ios --prod --release 

I was able to build ios --prod --release without any error. Thanks :D

    Mac-Pro-de-chaker-2:cleantoufoulakids chakerkalai$ ionic cordova build ios --prod --realise
Running app-scripts build: --prod --platform ios --target cordova
[18:22:05]  build prod started ... 
[18:22:07]  clean started ... 
[18:22:07]  clean finished in 2 ms 
[18:22:07]  copy started ... 
[18:22:07]  ngc started ... 
Error: Metadata version mismatch for module /Users/chakerkalai/Desktop/cleantoufoulakids/node_modules/@ionic-native/core/decorators.d.ts, found version 4, expected 3
    at StaticSymbolResolver.getModuleMetadata (/Users/chakerkalai/Desktop/cleantoufoulakids/node_modules/@angular/compiler/bundles/compiler.umd.js:24474:34)
    at StaticSymbolResolver._createSymbolsOf (/Users/chakerkalai/Desktop/cleantoufoulakids/node_modules/@angular/compiler/bundles/compiler.umd.js:24260:46)
    at StaticSymbolResolver.getSymbolsOf (/Users/chakerkalai/Desktop/cleantoufoulakids/node_modules/@angular/compiler/bundles/compiler.umd.js:24241:14)
    at /Users/chakerkalai/Desktop/cleantoufoulakids/node_modules/@angular/compiler/bundles/compiler.umd.js:23023:30
    at Array.forEach (native)
    at extractProgramSymbols (/Users/chakerkalai/Desktop/cleantoufoulakids/node_modules/@angular/compiler/bundles/compiler.umd.js:23022:79)
    at AotCompiler.compileAll (/Users/chakerkalai/Desktop/cleantoufoulakids/node_modules/@angular/compiler/bundles/compiler.umd.js:22720:47)
    at CodeGenerator.codegen (/Users/chakerkalai/Desktop/cleantoufoulakids/node_modules/@angular/compiler-cli/src/codegen.js:30:14)
    at Function.NgTools_InternalApi_NG_2.codeGen (/Users/chakerkalai/Desktop/cleantoufoulakids/node_modules/@angular/compiler-cli/src/ngtools_api.js:61:30)
    at Object.doCodegen (/Users/chakerkalai/Desktop/cleantoufoulakids/node_modules/@ionic/app-scripts/dist/aot/codegen.js:6:51)
[18:22:47]  copy finished in 40.10 s 
like image 357
Bouzafour Mohamed Avatar asked Mar 08 '23 15:03

Bouzafour Mohamed


2 Answers

It's all about libraries mismatching versions.

make sure you have "typescript": "2.4.0"and not newer.

And regarding all packages that start with "@ionic-native/..." their version should be 4.3.0 WITHOUT the ^ at the beginning.

and please don't upgrade to rxjs 5.5, use "rxjs": "5.4.3" since they changed the operators export/import.

note: if you still run into the problem of found version 4, expected 3 remove the hat ^ from the version of the library that caused the problem.

Best of luck!

like image 191
Mo Kawsara Avatar answered Mar 16 '23 03:03

Mo Kawsara


I'm guessing that there was a bump to one of the ionic-native dependencies today (I could build less than 24 hrs ago).

I was able to work around this by removing the ^ in my package.json for all ionic-native dependencies:

From:

    "@ionic-native/app-version": "^4.2.1",
    "@ionic-native/background-fetch": "^4.2.1",
    "@ionic-native/badge": "^4.0.1",
    "@ionic-native/contacts": "^4.2.1",
    "@ionic-native/core": "^4.2.1",
    "@ionic-native/date-picker": "^4.2.1",
    "@ionic-native/deeplinks": "^4.2.1",
    "@ionic-native/file": "^4.2.1",
    "@ionic-native/geolocation": "^4.2.1",
    "@ionic-native/keyboard": "^4.2.1",
    "@ionic-native/local-notifications": "^4.2.1",
    "@ionic-native/mixpanel": "^4.2.1",
    "@ionic-native/native-geocoder": "^4.2.1",
    "@ionic-native/network": "^4.2.1",
    "@ionic-native/screen-orientation": "^4.2.1",
    "@ionic-native/social-sharing": "^4.2.1",
    "@ionic-native/speech-recognition": "^4.1.0",
    "@ionic-native/splash-screen": "^4.2.1",
    "@ionic-native/status-bar": "^4.2.1",

To:

    "@ionic-native/app-version": "4.2.1",
    "@ionic-native/background-fetch": "4.2.1",
    "@ionic-native/badge": "4.0.1",
    "@ionic-native/contacts": "4.2.1",
    "@ionic-native/core": "4.2.1",
    "@ionic-native/date-picker": "4.2.1",
    "@ionic-native/deeplinks": "4.2.1",
    "@ionic-native/file": "4.2.1",
    "@ionic-native/geolocation": "4.2.1",
    "@ionic-native/keyboard": "4.2.1",
    "@ionic-native/local-notifications": "4.2.1",
    "@ionic-native/mixpanel": "4.2.1",
    "@ionic-native/native-geocoder": "4.2.1",
    "@ionic-native/network": "4.2.1",
    "@ionic-native/screen-orientation": "4.2.1",
    "@ionic-native/social-sharing": "4.2.1",
    "@ionic-native/speech-recognition": "4.1.0",
    "@ionic-native/splash-screen": "4.2.1",
    "@ionic-native/status-bar": "4.2.1",
like image 31
pherris Avatar answered Mar 16 '23 05:03

pherris