ionic cordova build android --prod 中的错误

Error in ionic cordova build android --prod(ionic cordova build android --prod 中的错误)
本文介绍了ionic cordova build android --prod 中的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

致命错误:CALL_AND_RETRY_LAST 分配失败 - JavaScript 堆内存不足

运行命令时出错:ionic cordova build android --prod

注意: ionic build androidionic run androidionic serve 都可以正常工作.p>

我读过很多主题,说一旦项目变大,它就会停止工作.

问题到达的前一天正在工作.随着我们添加更多文件和 JSON 以翻译多语言应用程序,它停止工作.

这是一个已知问题吗?有什么解决办法吗?

请查看更多详情:

离子信息:

解决方案

通过修改我在 C:UsersAppDataRoaming pm 中的 ionic.cmd 文件添加解决--max_old_space_size.我将我的设置为 8096.

@if EXIST "%~dp0
ode.exe" ("%~dp0
ode.exe" --max_old_space_size=8096 "%~dp0
ode_modulesionicinionic" %*) 别的 (@SETLOCAL@set PATHEXT=%PATHEXT:;.JS;=;%节点 --max_old_space_size=8096 "%~dp0
ode_modulesionicinionic" %*)

祝你好运!查看实际来源:https://github.com/ionic-team/ionic-cli/issues/1453

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

Error when running command: ionic cordova build android --prod

Note: that ionic build android, ionic run android and ionic serve all works fine.

I've read many topics that says once the project gets bigger, it stops working.

It was working the day before issue arrive. It stopped working as we added more files and JSON for translation of app in multi-language.

Is it a known issue? Is there any solution?

PLEASE CHECK FOR MORE DETAIL : https://youtu.be/oCN7iSt8rzg

Attached Error Image:

Ionic Info:

解决方案

Resolved by modifying my ionic.cmd file in C:UsersAppDataRoaming pm by adding --max_old_space_size. I set mine to 8096.

@if EXIST "%~dp0
ode.exe" (
"%~dp0
ode.exe" --max_old_space_size=8096 "%~dp0
ode_modulesionicinionic" %*
) ELSE (
@SETLOCAL
@set PATHEXT=%PATHEXT:;.JS;=;%
node --max_old_space_size=8096 "%~dp0
ode_modulesionicinionic" %*
)

Good luck! Check Actual Source: https://github.com/ionic-team/ionic-cli/issues/1453

这篇关于ionic cordova build android --prod 中的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Android release APK crash with java.lang.AssertionError: impossible in java.lang.Enum(Android 发布 APK 因 java.lang.AssertionError 崩溃:在 java.lang.Enum 中不可能)
Finished with Non Zero Exit Value 3(以非零退出值 3 结束)
On gradle:3.0.0 More than one file was found with OS independent path #39;META-INF/ASL2.0#39;(在 gradle:3.0.0 上找到多个文件,其独立于操作系统的路径为“META-INF/ASL2.0)
Android : app loading library at runtime on Lollipop but not IceCreamSandwich(Android:运行时在 Lollipop 上而不是 IceCreamSandwich 上的应用程序加载库)
buildConfigField depending on flavor + buildType(buildConfigField 取决于风味 + buildType)
How do I suppress warnings when compiling an android library with gradle?(使用 gradle 编译 android 库时如何抑制警告?)