ionic build android --prod --release fails with the below error
ionic build android --release is working fine
can’t resolve module @ionic-native/core from /MyProject/node_modules/@ionic-native/in-app-browser/index.d.ts
[10:20:09] build prod failed: Cannot read property 'Plugin' of undefined, resolving symbol InAppBrowser in /MyProject/node_modules/@ionic-native/in-app-browser/index.d.ts [10:20:09] ionic-app-script task: "build" [10:20:09] Error: Cannot read property 'Plugin' of undefined, resolving symbol InAppBrowser in /MyProject/node_modules/@ionic-native/in-app-browser/index.d.ts Error: Cannot read property 'Plugin' of undefined, resolving symbol InAppBrowser in /MyProject/node_modules/@ionic-native/in-app-browser/index.d.ts at simplifyInContext (/MyProject/node_modules/@angular/compiler-cli/src/static_reflector.js:475:23) at StaticReflector.simplify (/MyProject/node_modules/@angular/compiler-cli/src/static_reflector.js:478:22) at StaticReflector.annotations (/MyProject/node_modules/@angular/compiler-cli/src/static_reflector.js:60:36) at NgModuleResolver.resolve (/MyProject/node_modules/@angular/compiler/bundles/compiler.umd.js:14261:46) at CompileMetadataResolver._loadNgModuleMetadata (/MyProject/node_modules/@angular/compiler/bundles/compiler.umd.js:14646:45) at CompileMetadataResolver.getUnloadedNgModuleMetadata (/MyProject/node_modules/@angular/compiler/bundles/compiler.umd.js:14636:23) at addNgModule (/MyProject/node_modules/@angular/compiler/bundles/compiler.umd.js:12944:43) at /MyProject/node_modules/@angular/compiler/bundles/compiler.umd.js:12957:16 at Array.forEach (native) at _createNgModules (/MyProject/node_modules/@angular/compiler/bundles/compiler.umd.js:12956:28)
My package.json
**`
"dependencies": {
"@angular/common": "2.2.1",
"@angular/compiler": "2.2.1",
"@angular/compiler-cli": "2.2.1",
"@angular/core": "2.2.1",
"@angular/forms": "2.2.1",
"@angular/http": "2.2.1",
"@angular/platform-browser": "2.2.1",
"@angular/platform-browser-dynamic": "2.2.1",
"@angular/platform-server": "2.2.1",
"@ionic-native/core": "^3.4.4",
"@ionic-native/in-app-browser": "^3.4.4",
"@ionic-native/onesignal": "^3.4.4",
"@ionic/storage": "2.0.1",
"angular2-moment": "1.3.3",
"font-awesome": "^4.7.0",
"ionic-angular": "2.1.0",
"ionic-native": "2.4.1",
"ionic2-autosize": "1.0.2",
"ionicons": "3.0.0",
"moment": "^2.18.1",
"rxjs": "5.0.1",
"sw-toolbox": "3.4.0",
"zone.js": "0.6.26"
},
"devDependencies": {
"@ionic/app-scripts": "1.1.3",
"typescript": "2.0.9"
},**
`
You have both
and [quote=“praveenyoungind, post:1, topic:87428”]
“ionic-native”: “2.4.1”,
[/quote]
which are two different versions of the same library. Get rid of the 2.4.1 one and clean up the code if it is still using it.
1 Like
tried not working still getting the same error
1 Like
Your ionic/app-scripts is pretty old. Try updating it to the current version 1.3.4.
i changed my packages to below version
"dependencies": {
"@angular/common": "4.0.0",
"@angular/compiler": "4.0.0",
"@angular/compiler-cli": "4.0.0",
"@angular/core": "4.0.0",
"@angular/forms": "4.0.0",
"@angular/http": "4.0.0",
"@angular/platform-browser": "4.0.0",
"@angular/platform-browser-dynamic": "4.0.0",
"@ionic-native/core": "3.4.2",
"@ionic-native/splash-screen": "3.4.2",
"@ionic-native/status-bar": "3.4.2",
"@ionic/storage": "2.0.1",
"ionic-angular": "3.0.1",
"ionicons": "3.0.0",
"rxjs": "5.1.1",
"sw-toolbox": "3.4.0",
"zone.js": "^0.8.4",
"@ionic-native/in-app-browser": "^3.4.4",
"@ionic-native/onesignal": "^3.4.4",
"angular2-moment": "1.3.3",
"font-awesome": "^4.7.0",
"ionic2-autosize": "1.0.2",
"moment": "^2.18.1"
},
"devDependencies": {
"@ionic/app-scripts": "1.3.4",
"typescript": "^2.1.5"
},
> ionic serve
gives below error
[23:36:11] ionic-app-script task: "serve"
[23:36:11] Error: Cannot read property 'content' of undefined
Error: Cannot read property 'content' of undefined
at new BuildError (/Users/myuser/myproject/node_modules/@ionic/app-scripts/dist/util/errors.js:16:28)
at /Users/myuser/myproject/node_modules/@ionic/app-scripts/dist/preprocess.js:17:21
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/Cellar/node/7.9.0/bin/node" "/usr/local/bin/npm" "run" "ionic:serve" "--" "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"
npm ERR! node v7.9.0
npm ERR! npm v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ionic-hello-world@ ionic:serve: `ionic-app-scripts serve "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ionic-hello-world@ ionic:serve script 'ionic-app-scripts serve "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the ionic-hello-world package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! ionic-app-scripts serve "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs ionic-hello-world
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls ionic-hello-world
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/myuser/.npm/_logs/2017-04-22T18_06_11_174Z-debug.log
There was an error serving your Ionic application: There was an error with the spawned command: serve`
(I changed your post to format your code or error message correctly. Please use the </>
button above the post input field to format your code or error message or wrap it in ```
(“code fences”) manually. This will make sure your text is readable and if it recognizes the programming language it also automatically adds code syntax highlighting. Thanks.)
Did you delete node_modules
and then npm install
ed again?
You’re going to have to lose this. It has dependencies on an ancient version of Angular.
1 Like