卡在复制完成上,无法进行生产构建

时间:2018-06-25 05:37:54

标签: ionic3 angular5 angularfire2

我对angularfire2和ionic 3遇到了问题。基于https://github.com/angular/angularfire2/blob/master/docs/ionic/v3.md文档,该文档实现了从firebase读取数据,并且在 ionic服务中工作得很好。

当我使用生产版本 ionic cordova构建android --prod 时,终端在复制完成时停止执行,一小时后它会警告Javascript内存不足。

我从package.json中删除了angularfire2软件包,并尝试在 npm安装之后进行生产构建,

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

反正有解决问题的方法吗?

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

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

全局软件包:

cordova (Cordova CLI) : 8.0.0 

本地软件包:

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

系统:

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

环境变量:

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

其他:

backend : pro

2 个答案:

答案 0 :(得分:1)

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

来源:Link

答案 1 :(得分:0)

离子应用程序脚本与angularfire,firebase存在兼容性问题。为了使生活更轻松,请使用以下命令行:

ionic cordova run android --aot --minifyjs --minifycss --release