1

My ionic 3 application working fine in Ionic serve , But when taking build it’s keep on stops with the following error

==== JS stack trace =========================================
Security context: 000000200D3CFB49 <JS Object>
    1: DoJoin(aka DoJoin) [native array.js:~129] [pc=00000315AEFE6C02] (this=000000200D304381 <undefined>,w=000000FF69DCAE69 <JS Array[414]>,x=414,N=000000200D3043C1 <true>,J=000000200D3AE4C9 <String[1]:  >,I=000000200D3B46D9 <JS Function ConvertToString (SharedFunctionInfo 000000200D352DC9)>)
2: Join(aka Join) [native array.js:180] [pc=00000315AEFFA292] (this=000000200D304381 <undefined>...

 FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

And My ionic info

@ionic/cli-utils  : 1.10.2
  ionic (Ionic CLI) : 3.10.3

global packages:

  Cordova CLI : 7.0.1

local packages:

  @ionic/app-scripts : 2.1.4
  Cordova Platforms  : android 6.2.3
  Ionic Framework    : ionic-angular 3.6.1

System:

  Android SDK Tools : 24.4.1
  Node              : v6.10.3
  npm               : 3.10.10
  OS                : Windows 7

Thanks in advance

Raja Mohamed
  • 1,026
  • 9
  • 22
  • Possible duplicate of [FATAL ERROR: CALL\_AND\_RETRY\_LAST Allocation failed - JavaScript heap out of memory](https://stackoverflow.com/questions/38914471/fatal-error-call-and-retry-last-allocation-failed-javascript-heap-out-of-memo) – Rob Oct 03 '17 at 14:29
  • Why don't you try latest Ionic 3.7.1 https://github.com/ionic-team/ionic/releases/tag/v3.7.1 – Sampath Oct 03 '17 at 16:48
  • upgraded ionic, still same error – Raja Mohamed Oct 04 '17 at 12:24

2 Answers2

0

I have fixed the issue with these steps :

  1. Add "C:\Windows\System32" in Environment Environment variable Path .
  2. Remove Platform by ionic cordova platform rm android
  3. Add Platform using cordova by cordova platform add android
  4. Take build by ionic cordova run android
  5. Check generated Apk in your project , Ex : D:\Ionic3\testify\platforms\android\build\outputs\apk

I hope this is a problem caused by latest ionic version , Thanks all

Raja Mohamed
  • 1,026
  • 9
  • 22
0

I updated the build scripts in package.json and it worked.

  "scripts": {
    "clean": "ionic-app-scripts clean",
    "build": "node --max-old-space-size=2048 ./node_modules/.bin/ionic-app-scripts build",
    "lint": "ionic-app-scripts lint",
    "ionic:build": "node --max-old-space-size=2048 ./node_modules/.bin/ionic-app-scripts build",
    "ionic:serve": "ionic-app-scripts serve"
  },
Biranchi
  • 16,120
  • 23
  • 124
  • 161