【问题标题】:Ionic3 android build command not working - FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memoryIonic3 android 构建命令不起作用 - 致命错误:CALL_AND_RETRY_LAST 分配失败 - JavaScript 堆内存不足
【发布时间】:2018-03-14 18:52:06
【问题描述】:

我的 ionic 3 应用程序在 Ionic serve 中运行良好,但是在构建时它会继续停止并出现以下错误

==== 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

还有我的离子信息

@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

提前致谢

【问题讨论】:

标签: angular cordova ionic-framework ionic3


【解决方案1】:

我已通过以下步骤解决了问题:

  1. 在 Environment 环境变量 Path 中添加 "C:\Windows\System32"
  2. ionic cordova platform rm android 删除平台
  3. cordova platform add android使用cordova添加平台
  4. 通过 ionic cordova run android 构建
  5. 检查项目中生成的 Apk,例如:D:\Ionic3\testify\platforms\android\build\outputs\apk

我希望这是最新的离子版本引起的问题,谢谢大家

【讨论】:

    【解决方案2】:

    我更新了 package.json 中的构建脚本,它工作正常。

      "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"
      },
    

    【讨论】:

      猜你喜欢
      • 2016-12-19
      • 1970-01-01
      • 2018-11-10
      • 2018-09-25
      • 1970-01-01
      • 2019-12-17
      • 1970-01-01
      • 2018-08-20
      • 1970-01-01
      相关资源
      最近更新 更多