# I cant make a build with ionic --prod

**URL:** <https://forum.ionicframework.com/t/i-cant-make-a-build-with-ionic-prod/169903>\
**Category:** ionic-v3\
**Created:** [July 29, 2019, 1:34pm UTC](https://forum.ionicframework.com/t/i-cant-make-a-build-with-ionic-prod/169903 "2019-07-29T13:34:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wasiqaftab](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/wasiqaftab/32/127366_2.png) [@wasiqaftab](https://forum.ionicframework.com/u/wasiqaftab)\
**Post date:** [July 29, 2019, 1:34pm UTC](https://forum.ionicframework.com/t/i-cant-make-a-build-with-ionic-prod/169903/1 "2019-07-29T13:34:13Z")

</div>

HI

i am trying to make a build with --prod but its not working . i can make build easily with --dev command. Here is my json file

```auto
{
"name": "chimera",
"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": "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",
  "@ionic-native/admob-free": "4.20.0",
  "@ionic-native/call-number": "4.16.0",
  "@ionic-native/core": "4.4.0",
  "@ionic-native/email-composer": "4.16.0",
  "@ionic-native/file-opener": "^4.16.0",
  "@ionic-native/in-app-browser": "4.20.0",
  "@ionic-native/onesignal": "^4.20.0",
  "@ionic-native/social-sharing": "4.16.0",
  "@ionic-native/splash-screen": "4.4.0",
  "@ionic-native/status-bar": "4.4.0",
  "@ionic/cloud-angular": "0.12.0",
  "@ionic/pro": "1.0.16",
  "@ionic/storage": "2.1.3",
  "@ngx-translate/core": "9.1.1",
  "@ngx-translate/http-loader": "3.0.1",
  "angular2-masonry": "0.4.0",
  "call-number": "1.0.1",
  "cordova-admob-sdk": "^0.13.1",
  "cordova-android": "6.4.0",
  "cordova-ios": "4.5.5",
  "cordova-plugin-admob-free": "^0.13.0",
  "cordova-plugin-compat": "1.2.0",
  "cordova-plugin-device": "^1.1.7",
  "cordova-plugin-file-opener2": "^2.2.1",
  "cordova-plugin-inappbrowser": "^1.7.2",
  "cordova-plugin-ionic-webview": "^1.2.1",
  "cordova-plugin-splashscreen": "^4.1.0",
  "cordova-plugin-whitelist": "^1.3.4",
  "cordova-plugin-x-socialsharing": "^5.4.7",
  "cordova-promise-polyfill": "0.0.2",
  "es6-promise-plugin": "^4.2.2",
  "ionic-angular": "3.9.2",
  "ionic-marquee": "0.4.0",
  "ionic-plugin-keyboard": "^2.2.1",
  "ionicons": "3.0.0",
  "mx.ferreyra.callnumber": "0.0.2",
  "ng2-twitter": "0.3.0",
  "onesignal-cordova-plugin": "^2.5.0",
  "rxjs": "6.3.3",
  "rxjs-compat": "6.3.3",
  "sw-toolbox": "3.6.0",
  "webpack-sources": "1.3.0",
  "xml2js": "0.4.19",
  "zone.js": "0.8.18"
},
"devDependencies": {
  "@ionic/app-scripts": "3.2.4",
  "@ionic/lab": "1.0.2",
  "@types/xml2js": "0.4.3",
  "typescript": "2.4.2"
},
"description": "An Ionic project",
"cordova": {
  "plugins": {
    "cordova-plugin-inappbrowser": {},
    "cordova-plugin-x-socialsharing": {
      "ANDROID_SUPPORT_V4_VERSION": "24.1.1+",
      "PHOTO_LIBRARY_ADD_USAGE_DESCRIPTION": "This app requires photo library access to function properly.",
      "PHOTO_LIBRARY_USAGE_DESCRIPTION": "This app requires photo library access to function properly."
    },
    "mx.ferreyra.callnumber": {},
    "cordova-plugin-admob-free": {
      "ADMOB_APP_ID": "ca-app-pub-2899054860592317~3367233553"
    },
    "cordova-plugin-device": {},
    "cordova-plugin-ionic-webview": {},
    "cordova-plugin-splashscreen": {},
    "cordova-plugin-whitelist": {},
    "ionic-plugin-keyboard": {},
    "call-number": {},
    "cordova-plugin-file-opener2": {
      "ANDROID_SUPPORT_V4_VERSION": "27.+"
    },
    "onesignal-cordova-plugin": {}
  },
  "platforms": [
    "android",
    "ios"
  ]
}
}

```

Please see my CLI info

```auto
Ionic:

   Ionic CLI : 5.0.2 (/usr/local/lib/node_modules/ionic)
   Ionic Framework : ionic-angular 3.9.2
   @ionic/app-scripts : 3.2.4

Cordova:

   Cordova CLI : 8.0.0
   Cordova Platforms : android 6.4.0
   Cordova Plugins : cordova-plugin-ionic-webview 1.2.1, (and 9 other plugins)

Utility:

   cordova-res : not installed
   native-run : 0.2.8

System:

   ios-deploy : 1.9.4
   NodeJS : v8.12.0 (/usr/local/bin/node)
   npm : 6.4.1
   OS : macOS Mojave
   Xcode : Xcode 10.3 Build version 10G8

```

And lastly thats the error what i am getting . i am not sure and dont know which file is causing this issue

```auto
ionic-app-scripts build --prod --target cordova --platform android
[14:19:04] ionic-app-scripts 3.2.4 
[14:19:04] build prod started ... 
[14:19:04] clean started ... 
[14:19:04] clean finished in 2 ms 
[14:19:04] copy started ... 
[14:19:05] deeplinks started ... 
[14:19:05] deeplinks finished in 260 ms 
[14:19:05] ngc started ... 
[14:19:12] typescript error 
            Error during template compile of 'BrowserXhr' Function calls are not supported in decorators but 
            'makeDecorator' was called in 'Injectable' 'Injectable' references 'Injectable' 'Injectable' references 
            'Injectable' 'Injectable' references 'Injectable' 'Injectable' calls 'makeDecorator'. 

[14:19:12] ionic-app-script task: "build" 
[14:19:12] Error: The Angular AoT build failed. See the issues above 
Error: The Angular AoT build failed. See the issues above
    at /Users/wasiq/Desktop/development/fantaproapp/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:237:55
    at step (/Users/wasiq/Desktop/development/fantaproapp/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:32:23)
    at Object.next (/Users/wasiq/Desktop/development/fantaproapp/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:13:53)
    at fulfilled (/Users/wasiq/Desktop/development/fantaproapp/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:4:58)
    at <anonymous>
[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.
  ionic:utils-process onBeforeExit handler: 'process.exit' received +0ms
  ionic:utils-process onBeforeExit handler: running 4 functions +0ms
  ionic:utils-process processExit: exiting (exit code: 1) +29ms

```

Any help will be appreciated

---

<div class="post-metadata">

**Author:** ![chiemeka](https://avatars.discourse-cdn.com/v4/letter/c/e9bcb4/32.png) [@chiemeka](https://forum.ionicframework.com/u/chiemeka)\
**Post date:** [October 25, 2020, 4:38am UTC](https://forum.ionicframework.com/t/i-cant-make-a-build-with-ionic-prod/169903/2 "2020-10-25T04:38:52Z")

</div>

hi @wasiq, did you later solve this problem. If yes, how did you do it please…
