Angular AoT构建失败

问题描述 投票:0回答:1

运行此命令后:-离子cordova构建android --aot

[[12:00:25] ionic-app-script任务:“构建” [12:00:25]错误:Angular AoT构建失败。请参阅上面的问题错误:角度范围构建失败。看到上面的问题在C:\ Users \ Admin \ Git \ olm_android \ node_modules @ ionic \ app-scripts \ dist \ aot \ aot-compiler.js:237:55在步骤(C:\ Users \ Admin \ Git \ olm_android \ node_modules @ ionic \ app-scripts \ dist \ aot \ aot-compiler.js:32:23)在Object.next(C:\ Users \ Admin \ Git \ olm_android \ node_modules @ ionic \ app-scripts \ dist \ aot \ aot-compiler.js:13:53)完成时(C:\ Users \ Admin \ Git \ olm_android \ node_modules @ ionic \ app-scripts \ dist \ aot \ aot-compiler.js:4:58)[错误]运行子流程ionic-app-scripts时发生错误。

Error Image

构建后出现错误

ionic cordova build android --release --aot

构建Apk失败,并且在正常运行后,需要花费一些时间才能在移动设备上加载...需要花费大量时间来加载打开组件

我的依赖项

"dependencies": {
    "@angular/animations": "^5.1.1",
    "@angular/cdk": "^5.0.1",
    "@angular/common": "5.2.10",
    "@angular/compiler": "5.2.10",
    "@angular/compiler-cli": "5.2.10",
    "@angular/core": "5.2.10",
    "@angular/fire": "^5.2.1",
    "@angular/forms": "5.2.10",
    "@angular/http": "5.2.10",
    "@angular/material": "^5.0.1",
    "@angular/platform-browser": "5.2.10",
    "@angular/platform-browser-dynamic": "5.2.10",
    "@ionic-native/core": "4.7.0",
    "@ionic-native/fcm": "^4.12.2",
    "@ionic-native/file": "^4.11.0",
    "@ionic-native/file-opener": "^4.11.0",
    "@ionic-native/file-transfer": "^4.11.0",
    "@ionic-native/firebase": "^4.7.0",
    "@ionic-native/firebase-messaging": "^4.11.0",
    "@ionic-native/header-color": "^4.7.0",
    "@ionic-native/in-app-browser": "^4.11.0",
    "@ionic-native/social-sharing": "^4.20.0",
    "@ionic-native/splash-screen": "4.7.0",
    "@ionic-native/status-bar": "^4.7.0",
    "@ionic/angular": "^4.4.2",
    "@ionic/core": "^4.4.2",
    "@ionic/lab": "^1.0.13",
    "@ionic/pro": "1.0.20",
    "@ionic/storage": "2.1.3",
    "angularfire2": "^5.0.0-rc.6",
    "cordova-android": "7.1.4",
    "cordova-android-support-gradle-release": "^1.4.7",
    "cordova-browser": "^6.0.0",
    "cordova-plugin-console": "^1.1.0",
    "cordova-plugin-device": "^2.0.3",
    "cordova-plugin-file": "^6.0.2",
    "cordova-plugin-file-opener2": "^2.2.1",
    "cordova-plugin-file-transfer": "^1.7.1",
    "cordova-plugin-headercolor": "^1.0.0",
    "cordova-plugin-inappbrowser": "^3.1.0",
    "cordova-plugin-ionic-keyboard": "^2.2.0",
    "cordova-plugin-ionic-webview": "^1.2.1",
    "cordova-plugin-splashscreen": "^5.0.3",
    "cordova-plugin-statusbar": "^2.4.3",
    "cordova-plugin-whitelist": "^1.3.4",
    "cordova-plugin-x-socialsharing": "^5.6.3",
    "cordova-support-android-plugin": "^1.0.1",
    "cordova-support-google-services": "^1.2.1",
    "es6-promise-plugin": "^4.2.2",
    "firebase": "^4.12.1",
    "ionic-angular": "3.9.2",
    "ionic-selectable": "^3.0.3",
    "ionicons": "3.0.0",
    "jwt-decode": "^2.2.0",
    "natives": "^1.1.6",
    "ngx-qrcode2": "0.0.9",
    "rxjs": "5.5.10",
    "sw-toolbox": "3.6.0",
    "zone.js": "0.8.26"
  },
  "devDependencies": {
    "@ionic/app-scripts": "3.2.4",
    "@ionic/cli-plugin-cordova": "1.6.2",
    "typescript": "~2.6.2"
  },
  "description": "An Ionic project",
  "cordova": {
    "plugins": {
      "cordova-plugin-statusbar": {},
      "cordova-plugin-headercolor": {},
      "cordova-plugin-whitelist": {},
      "cordova-plugin-device": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-ionic-webview": {},
      "cordova-plugin-ionic-keyboard": {},
      "cordova-plugin-file-transfer": {},
      "cordova-plugin-file": {},
      "cordova-plugin-file-opener2": {
        "ANDROID_SUPPORT_V4_VERSION": "27.+"
      },
      "cordova-android-support-gradle-release": {
        "ANDROID_SUPPORT_VERSION": "27.+"
      },
      "cordova-plugin-inappbrowser": {},
      "cordova-plugin-console": {},
      "cordova-plugin-x-socialsharing": {
        "ANDROID_SUPPORT_V4_VERSION": "24.1.1+"
      }
    },
    "platforms": [
      "browser",
      "ios",
      "android"
    ]
  }
}
javascript angular ionic-framework build-error
1个回答
0
投票

AdminverifyUnverify请求页面在模块中声明,因此抛出错误。请在app.module.ts或adminverifyUnverify.module.ts中的单个位置定义一个组件。

如果未将其作为模式控制器打开,则将其从app.module.ts中删除。

[AOT编译器意味着[生产版本]不允许在任何地方声明任何重复的组件。

© www.soinside.com 2019 - 2024. All rights reserved.