I am using command ionic cordova build android --prod.
I am getting this as error:
Error: Type LoginPage in C:/Users/aksha/Desktop/ionic_apps/askGanesha/src/pages/login/login.ts is part of the declarations of 2 modules: AppModule in C:/Users/aksha/Desktop/ionic_apps/askGanesha/src/app/
app.module.ts and LoginPageModule in C:/Users/aksha/Desktop/ionic_apps/askGanesha/src/pages/login/login.module.ts! Please consider moving LoginPage in C:/Users/aksha/Desktop/ionic_apps/askGanesha/src/pag
es/login/login.ts to a higher module that imports AppModule in C:/Users/aksha/Desktop/ionic_apps/askGanesha/src/app/app.module.ts and LoginPageModule in C:/Users/aksha/Desktop/ionic_apps/askGanesha/src/p
ages/login/login.module.ts. You can also create a new NgModule that exports and includes LoginPage in C:/Users/aksha/Desktop/ionic_apps/askGanesha/src/pages/login/login.ts then import that NgModule in Ap
pModule in C:/Users/aksha/Desktop/ionic_apps/askGanesha/src/app/app.module.ts and LoginPageModule in C:/Users/aksha/Desktop/ionic_apps/askGanesha/src/pages/login/login.module.ts.
I have a LoginPage in my app, i didn’t understand what the error says please help.
Thanks for reply.
I am not using lazy loading and didn’t even touched LoginPageModule ionic
generated that by itself. It is necessary or can I remove it?
I have just imported LoginPage into app.module.ts and added it to
declarations and entryComponents array.
Ah, then yeah you can remove it. If you have other modules for pages you’ll want to remove them too. The Ionic CLI assumes you’ll be using lazy loading, and thus generates modules for you.
This has absolutely nothing to do with the problem @akshatbhargava123 has. Using the cordova command directly even doesn’t build the Ionic project at all, where he/she has the problem.