我正嘗試構建離子應用程序的生產構建。未能爲我的離子2應用程序構建生產構建
ionic run android
但是,當我試圖通過使用
ionic run android --prod
我收到此錯誤打造我的生產應用:
Cannot read property 'componentType' of undefined main.js:7.
,如果正在運行與我的應用程序,一切工作正常我的應用程序停留在閃屏
這是我的package.json
{
"name": "ionic-hello-world",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"private": true,
"scripts": {
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve"
},
"dependencies": {
"@angular/common": "2.2.1",
"@angular/compiler": "2.2.1",
"@angular/compiler-cli": "2.2.1",
"@angular/core": "2.2.1",
"@angular/forms": "2.2.1",
"@angular/http": "2.2.1",
"@angular/platform-browser": "2.2.1",
"@angular/platform-browser-dynamic": "2.2.1",
"@angular/platform-server": "2.2.1",
"@ionic/cloud-angular": "^0.11.0",
"@ionic/storage": "1.1.7",
"angular2-focus": "^1.0.3",
"angular2-moment": "^1.1.0",
"ionic-angular": "2.0.0-rc.4",
"ionic-gallery-modal": "0.0.7",
"ionic-native": "2.2.11",
"ionicons": "3.0.0",
"rxjs": "5.0.0-beta.12",
"sw-toolbox": "3.4.0",
"zone.js": "0.6.26"
},
"devDependencies": {
"@ionic/app-scripts": "1.0.0",
"typescript": "2.0.9"
},
"cordovaPlugins": [
"cordova-plugin-whitelist",
"cordova-plugin-console",
"cordova-plugin-statusbar",
"cordova-plugin-device",
"cordova-plugin-splashscreen",
"ionic-plugin-keyboard"
],
"cordovaPlatforms": [],
"description": "App: An Ionic project"
}
如果我使用上面的命令構建它,然後對它進行簽名並嘗試在設備中安裝,即使它在啓動屏幕上停止, – devanshsadhotra
您是否在任何位置使用componentType? –
它只是在main.js中,並且沒有其他地方我已經在我的應用程序中使用它 – devanshsadhotra