简体   繁体   English

离子cordova构建android –prod –release失败,无法解析'./app.module.ngfactory

[英]Ionic cordova build android –prod –release fails with Can't resolve './app.module.ngfactory

I'm working with Ionic 3. When I try cordova build android --prod --release , a build is done, but the signed APK is showing white screen after splash. 我正在使用cordova build android --prod --release 。当我尝试cordova build android --prod --release ,构建已完成,但签名的APK在启动后显示白屏。 When I try ionic cordova build android --prod --release , it is showing the following error. 当我尝试ionic cordova build android --prod --release ,它显示以下错误。

在此处输入图片说明

Main.ts Main.ts

 import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { AppModule } from './app.module'; platformBrowserDynamic().bootstrapModule(AppModule); 

app.module.ts app.module.ts

 import { NgModule, ErrorHandler } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular'; import { MyApp } from './app.component'; import { FormsModule } from '@angular/forms'; import { HttpModule } from '@angular/http'; import { BarcodeScanner } from '@ionic-native/barcode-scanner'; import { AppRate } from '@ionic-native/app-rate'; import { PopoverPage } from '../pages/popover/popover'; import { TabsPage } from '../pages/tabs/tabs'; import { StatusBar } from '@ionic-native/status-bar'; import { SplashScreen } from '@ionic-native/splash-screen'; import { LoginPage } from '../pages/login/login'; import { PostService } from './app.postservice'; import { UrlService } from './app.service'; import { GetService } from './app.getservice'; import { AppVersion } from '@ionic-native/app-version'; import { SlidersPage } from '../pages/sliders/sliders'; @NgModule({ declarations: [ MyApp, TabsPage, LoginPage, SlidersPage ], imports: [ BrowserModule, HttpModule, IonicModule.forRoot(MyApp,{ tabsHideOnSubPages: true }) ], bootstrap: [IonicApp], entryComponents: [ MyApp, LoginPage, SlidersPage ], providers: [ StatusBar, SplashScreen, AppVersion, AppRate, BarcodeScanner, {provide: ErrorHandler, useClass: IonicErrorHandler}, {provide: PostService, useClass: PostService}, {provide: UrlService, useClass: UrlService}, {provide: GetService, useClass: GetService}, ], }) export class AppModule {} 

Ionic info gives 离子信息给

cli packages: (C:\\Users\\akrra\\AppData\\Roaming\\npm\\node_modules) cli软件包:(C:\\ Users \\ akrra \\ AppData \\ Roaming \\ npm \\ node_modules)

@ionic/cli-utils  : 1.19.0
ionic (Ionic CLI) : 3.19.0

global packages: 全局软件包:

cordova (Cordova CLI) : 7.1.0

local packages: 本地套餐:

@ionic/app-scripts : 3.1.2
Cordova Platforms  : android 6.3.0 windows 5.0.0
Ionic Framework    : ionic-angular 3.9.2

System: 系统:

Node : v9.2.0
npm  : 5.5.1
OS   : Windows 10

Environment Variables: 环境变量:

ANDROID_HOME : not set

Misc: 其他:

backend : legacy

Ionic Cli seems to be having issues with reporting the correct error when running with --prod option. 当使用--prod选项运行时,Ionic Cli似乎在报告正确错误时遇到问题。 It is throwing "Can't resolve './app.module.ngfactory'" instead of the correct error message. 它抛出“无法解析'./app.module.ngfactory'”,而不是正确的错误消息。

It is being tracked here and here . 它在这里这里被跟踪。

A developer with Ionic Dan Bucholtz suggested a workaround to retrieve the actual error message here . Ionic Dan Bucholtz的开发人员建议了一种解决方法,以在此处检索实际的错误消息。

In the meantime, to see the errors in your application and fix them, try running: 同时,要查看应用程序中的错误并进行修复,请尝试运行:

 ./node_modules/.bin/ngc 

You can run the above command to figure out what the real issue in your app is. 您可以运行上面的命令来找出您应用中真正的问题是什么。

暂无
暂无

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

相关问题 找不到模块:错误:无法解析'./app.module.ngfactory'-离子3,角度5 - Module not found: Error: Can't resolve './app.module.ngfactory' - ionic 3, angular 5 找不到模块:'./app.module.ngfactory'我在构建iOS应用--prod --release时 - Module not found: './app.module.ngfactory' i while build iOS app --prod --release 找不到模块:错误:无法解析“ ./$$_gendir/app/app.app.module.ngfactory” - Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' 找不到模块:错误:无法解析'./$$_gendir/app/app.module.ngfactory' - Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in 找不到模块:错误:无法解析'./$$_gendir/app/app.module.ngfactory' - Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' ./src/main.ts中的ngcli 6.1.3错误-无法解析'./app/app.module.ngfactory' - ngcli 6.1.3 ERROR in ./src/main.ts - Can't resolve './app/app.module.ngfactory' Angular 4错误-./src/main.ts中找不到错误:错误:无法解析'./$$_gendir/app/app.app.module.ngfactory' - Angular 4 error - ERROR in ./src/main.ts Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' 错误:无法解析“ C:\\ projects \\ Project-CMS \\ Project.Web \\ src”中的“ ./app/app.module.ngfactory” - Error: Can't resolve './app/app.module.ngfactory' in 'C:\projects\Project-CMS\Project.Web\src' 带有 ionic 4 的自定义 angular 7 库 - 无法解决“../@ionic/angular/dist/core.ngfactory”构建产品错误 - Custom angular 7 library with ionic 4 - Can't resolve '../@ionic/angular/dist/core.ngfactory' build prod error Angular AOT&Rollup - 无法解析'app.module.ngfactory' - Angular AOT & Rollup - Could not resolve 'app.module.ngfactory'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM