Angular ionic构建android--prod--release中的AOT错误

Angular ionic构建android--prod--release中的AOT错误,angular,typescript,ionic3,Angular,Typescript,Ionic3,我有一个爱奥尼亚项目。 在爱奥尼亚服务或爱奥尼亚构建安卓系统中没有问题。 但是在版本apk中使用-prod时,抛出异常: 我不明白问题是什么。 如何诊断问题出在哪里?看,错误告诉您问题可能出在哪里: Add IonicApp to the NgModule to fix it. Cannot determine the module for class ClickBlock in... 您是否向模块中添加了IonicApp?我解决了问题,将angular的5.2.11版本更改为5.2.8是的

我有一个爱奥尼亚项目。 在爱奥尼亚服务或爱奥尼亚构建安卓系统中没有问题。 但是在版本apk中使用-prod时,抛出异常:

我不明白问题是什么。
如何诊断问题出在哪里?

看,错误告诉您问题可能出在哪里:

Add IonicApp to the NgModule to fix it. 
Cannot determine the module for class ClickBlock in...

您是否向模块中添加了IonicApp?

我解决了问题,将angular的5.2.11版本更改为5.2.8

是的,IonicApp通过引导添加到主NgModule:[IonicApp]
"dependencies": {
    "@angular/animations": "5.2.11",
    "@angular/common": "5.2.11",
    "@angular/compiler": "5.2.11",
    "@angular/compiler-cli": "5.2.11",
    "@angular/core": "5.2.11",
    "@angular/forms": "5.2.11",
    "@angular/http": "5.2.11",
    "@angular/platform-browser": "5.2.11",
    "@angular/platform-browser-dynamic": "5.2.11",
    "@angular/router": "5.2.11",
    "@ionic-native/contacts": "4.9.2",
    "@ionic-native/core": "4.9.2",
    "@ionic-native/deeplinks": "^4.9.2",
    "@ionic-native/device": "4.9.2",
    "@ionic-native/diagnostic": "^4.9.2",
    "@ionic-native/file": "^4.9.2",
    "@ionic-native/file-opener": "^4.9.2",
    "@ionic-native/file-transfer": "^4.9.2",
    "@ionic-native/geolocation": "^4.9.2",
    "@ionic-native/in-app-browser": "4.9.2",
    "@ionic-native/network": "4.9.2",
    "@ionic-native/push": "^4.9.2",
    "@ionic-native/sim": "4.9.2",
    "@ionic-native/social-sharing": "4.9.2",
    "@ionic-native/splash-screen": "4.9.2",
    "@ionic-native/status-bar": "^4.9.2",
    "@ionic/storage": "2.1.3",
    "@ngx-translate/core": "9.1.1",
    "@ngx-translate/http-loader": "2.0.1",
    "@types/leaflet": "1.2.8",
    "com.lampa.startapp": "^6.1.6",
    "cordova-android": "7.1.0",
    "cordova-plugin-console": "^1.1.0",
    "cordova-plugin-contacts": "^3.0.1",
    "cordova-plugin-device": "^2.0.2",
    "cordova-plugin-file": "^6.0.1",
    "cordova-plugin-file-opener2": "^2.0.19",
    "cordova-plugin-file-transfer": "^1.7.1",
    "cordova-plugin-geolocation": "^4.0.1",
    "cordova-plugin-inappbrowser": "^3.0.0",
    "cordova-plugin-network-information": "^2.0.1",
    "cordova-plugin-sim": "^1.3.3",
    "cordova-plugin-splashscreen": "^5.0.2",
    "cordova-plugin-statusbar": "^2.4.2",
    "cordova-plugin-whitelist": "^1.3.3",
    "cordova-plugin-x-socialsharing": "^5.4.1",
    "cordova-support-google-services": "^1.2.0",
    "cordova-universal-links-plugin": "^1.2.1",
    "cordova.plugins.diagnostic": "^4.0.8",
    "es6-promise-plugin": "^4.2.2",
    "intersection-observer": "0.5.0",
    "ionic": "^3.20.0",
    "ionic-angular": "3.9.2",
    "ionic-img-viewer": "2.9.0",
    "ionic-plugin-deeplinks": "^1.0.17",
    "ionic-plugin-deploy": "^0.6.7",
    "ionic-plugin-keyboard": "^2.2.1",
    "ionic-stepper": "^1.1.0",
    "ionic2-rating": "^1.2.2",
    "ionicons": "4.2.4",
    "jalali-moment": "3.1.2",
    "leaflet": "1.3.1",
    "leaflet.label": "0.2.4",
    "libphonenumber-js": "1.2.21",
    "moment": "2.22.2",
    "ng-in-viewport": "1.2.8",
    "ng2-validation": "4.2.0",
    "phonegap-plugin-multidex": "^1.0.0",
    "phonegap-plugin-push": "^2.2.3",
    "promise-polyfill": "8.0.0",
    "rxjs": "5.5.10",
    "sw-toolbox": "3.6.0",
    "underscore": "1.9.1",
    "zone.js": "0.8.26"
},
"devDependencies": {
    "@ionic/app-scripts": "^3.1.11",
    "typescript": "2.9.2"
}
Add IonicApp to the NgModule to fix it. 
Cannot determine the module for class ClickBlock in...