简体   繁体   English

Angular AoT 构建失败

[英]The Angular AoT build failed

After Run the this command :- ionic cordova build android --aot运行此命令后:- ionic cordova build android --aot

[12:00:25] ionic-app-script task: "build" [12:00:25] Error: The Angular AoT build failed. [12:00:25] ionic-app-script 任务:“构建”[12:00:25] 错误:Angular AoT 构建失败。 See the issues above Error: The Angular AoT build failed.请参阅上面的问题错误:Angular AoT 构建失败。 See the issues above at C:\\Users\\Admin\\Git\\olm_android\\node_modules@ionic\\app-scripts\\dist\\aot\\aot-compiler.js:237:55 at step (C:\\Users\\Admin\\Git\\olm_android\\node_modules@ionic\\app-scripts\\dist\\aot\\aot-compiler.js:32:23) at Object.next (C:\\Users\\Admin\\Git\\olm_android\\node_modules@ionic\\app-scripts\\dist\\aot\\aot-compiler.js:13:53) at fulfilled (C:\\Users\\Admin\\Git\\olm_android\\node_modules@ionic\\app-scripts\\dist\\aot\\aot-compiler.js:4:58) [ERROR] An error occurred while running subprocess ionic-app-scripts.在 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错误图像

Error Comes After Build构建后出现错误

ionic cordova build android --release --aot离子科尔多瓦构建 android --release --aot

Failed To build Apk and after normal run it will take time to load on mobile...taking to much time to load open an component构建 Apk 失败,正常运行后,在移动设备上加载需要时间......加载打开组件需要很多时间

My dependencies我的依赖

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

AdminverifyUnverify request page is declared in module so it is throwing error. AdminverifyUnverify 请求页面在模块中声明,因此它抛出错误。 Please define a component in a single place either in app.module.ts or adminverifyUnverify.module.ts.请在 app.module.ts 或 adminverifyUnverify.module.ts 中的一个地方定义一个组件。

remove it from app.module.ts if not opening it as a modal controller.如果不将其作为模态控制器打开,请将其从 app.module.ts 中删除。

AOT compiler means [ production build ] not allowed any duplicate component to be declared in multiple places. AOT 编译器意味着 [production build] 不允许在多个地方声明任何重复的组件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM