Want to generate Ionic-android APK


#1

E:\inautical\vamoosestaticapp>ionic cordova build android --prod --release

i want to generate APK so thats why i am entering above command then show following erros massage…can any one help me

Running app-scripts build: --prod --platform android --target cordova
[18:57:47] build prod started …
[18:57:47] clean started …
[18:57:47] clean finished in 13 ms
[18:57:47] copy started …
[18:57:47] deeplinks started …
[18:57:47] deeplinks finished in 108 ms
[18:57:47] ngc started …
[18:57:58] typescript error
Type CheckPage in E:/inautical/vamoosestaticapp/src/pages/check/check.ts is part of the declarations of 2
modules: AppModule in E:/inautical/vamoosestaticapp/src/app/app.module.ts and CheckPageModule in
E:/inautical/vamoosestaticapp/src/pages/check/check.module.ts! Please consider moving CheckPage in
E:/inautical/vamoosestaticapp/src/pages/check/check.ts to a higher module that imports AppModule in
E:/inautical/vamoosestaticapp/src/app/app.module.ts and CheckPageModule in
E:/inautical/vamoosestaticapp/src/pages/check/check.module.ts. You can also create a new NgModule that
exports and includes CheckPage in E:/inautical/vamoosestaticapp/src/pages/check/check.ts then import that
NgModule in AppModule in E:/inautical/vamoosestaticapp/src/app/app.module.ts and CheckPageModule in
E:/inautical/vamoosestaticapp/src/pages/check/check.module.ts.

Error: The Angular AoT build failed. See the issues above
at E:\inautical\vamoosestaticapp\node_modules@ionic\app-scripts\dist\aot\aot-compiler.js:237:55
at step (E:\inautical\vamoosestaticapp\node_modules@ionic\app-scripts\dist\aot\aot-compiler.js:32:23)
at Object.next (E:\inautical\vamoosestaticapp\node_modules@ionic\app-scripts\dist\aot\aot-compiler.js:13:53)
at fulfilled (E:\inautical\vamoosestaticapp\node_modules@ionic\app-scripts\dist\aot\aot-compiler.js:4:58)


#2

Hello,
maybe you have declared Checkpage in two different ngModule.
Maybe 1 time in app.module.ts as Checkpage and in Checkpage.module,ts as CheckpageComponent

Dependend on whitch kind of nav you will prevere, lazy loading or don’t know loading you must use this or that, you can mix declaration and use it with different pages but can’t use both for one page.

Maybe it helps, best regards anna-liebt


#3

Hi sir,

Thank you so much. Let I check link and implement it.