Stuck on Copy Finished, Not able to take production build

Issue

I have an issue with angularfire2 and ionic 3. Based on the documentation https://github.com/angular/angularfire2/blob/master/docs/ionic/v3.md implemented the fetching of data from firebase and its working very good in ionic serve.

When I took the production build ionic cordova build android –prod, Terminal stop execution at copy finished and after an hour it alerting that the Javascript out of memory.

I removed the angularfire2 package from package.json and try to take production build after npm install, it working without any issues.

"dependencies": {
  "@angular/animations": "5.2.10",
  "@angular/common": "5.2.10",
  "@angular/compiler": "5.2.10",
  "@angular/compiler-cli": "5.2.10",
  "@angular/core": "5.2.10",
  "@angular/forms": "5.2.10",
  "@angular/http": "5.2.10",
  "@angular/platform-browser": "5.2.10",
  "@angular/platform-browser-dynamic": "5.2.10",
  "@ionic-native/core": "4.7.0",
  "@ionic-native/native-page-transitions": "^4.7.0",
  "@ionic-native/splash-screen": "4.7.0",
  "@ionic-native/status-bar": "4.7.0",
  "@ionic/storage": "^2.1.3",
  "angularfire2": "^5.0.0-rc.10",
  "com.telerik.plugins.nativepagetransitions": "^0.6.5",
  "cordova-android": "7.0.0",
  "cordova-plugin-device": "^2.0.2",
  "cordova-plugin-ionic-keyboard": "2.0.5",
  "cordova-plugin-ionic-webview": "^1.1.19",
  "cordova-plugin-splashscreen": "^5.0.2",
  "cordova-plugin-whitelist": "^1.3.3",
  "cordova-sqlite-storage": "^2.3.2",
  "firebase": "^5.0.4",
  "ionic-angular": "3.9.2",
  "ionic-select-searchable": "^2.0.0",
  "ionicons": "3.0.0",
  "run": "1.4.0",
  "rxjs": "^6.2.1",
  "rxjs-compat": "^6.2.1",
  "socket.io": "^2.1.1",
  "sw-toolbox": "3.6.0",
  "zone.js": "0.8.26"
},

Is there anyway to solve the issue ?

cli packages: (/usr/local/lib/node_modules)

@ionic/cli-utils  : 1.19.2
ionic (Ionic CLI) : 3.20.0

global packages:

cordova (Cordova CLI) : 8.0.0 

local packages:

@ionic/app-scripts : 3.1.9
Cordova Platforms  : android 7.0.0
Ionic Framework    : ionic-angular 3.9.2

System:

Android SDK Tools : 26.1.1
Node              : v8.11.1
npm               : 6.0.1 
OS                : Linux 4.4

Environment Variables:

ANDROID_HOME : /home/jishad/android-sdk-linux/

Misc:

backend : pro

Solution

ionic cordova build ios --aot --minifyjs --minifycss --release

Source: Link

Answered By – Crystal

Answer Checked By – Willingham (AngularFixing Volunteer)

Leave a Reply

Your email address will not be published.