As I strive to generate my APK for Android, I executed the following command:
ionic cordova run android --prod --release
Version of Ionic being used: Ionic V3
My app currently does not employ lazy loading (I confess I am not even sure how to go about that hahah) and I have relied on the Ionic CLI to create each page.
Upon running the above command, I encountered the following error:
Error: Type AutomaticPage in C:/Users/tamo/Desktop/dpHydmech/Hydmech/src/pages/automatic/automatic.ts is part of the declarations of 2 modules: AppModule in C:/Users/tamo/Desktop/dpHydmech/Hydmech/src/app/app.module.ts and AutomaticPageModule in C:/Users/tamo/Desktop/dpHydmech/Hydmech/src/pages/automatic/automatic.module.ts!
Please consider moving AutomaticPage in C:/Users/tamo/Desktop/dpHydmech/Hydmech/src/pages/automatic/automatic.ts to a higher module that imports AppModule in C:/Users/tamo/Desktop/dpHydmech/Hydmech/src/app/app.module.ts and AutomaticPageModule in C:/Users/tamo/Desktop/dpHydmech/Hydmech/src/pages/automatic/automatic.module.ts. You can also create a new NgModule that exports and includes AutomaticPage in C:/Users/tamo/Desktop/dpHydmech/Hydmech/src/pages/automatic/automatic.ts
then import that NgModule in AppModule in C:/Users/tamo/Desktop/dpHydmech/Hydmech/src/app/app.module.ts and AutomaticPageModule in C:/Users/tamo/Desktop/dpHydmech/Hydmech/src/pages/automatic/automatic.module.ts.
Actions I have attempted to resolve this:
- Deleting file automatic.module.ts
- Removing imports from automatic.module.ts entirely
- Eliminating the import of AutomaticPageModule from app.module.ts
I delved into this discussion:
Any recommendations on how to rectify this issue?