Error: Type LoginPage in C:/ionic/walldo/src/pages/login/login.ts is part of the declarations of 2 modules

Full error:
Error: Type LoginPage in C:/ionic/walldo/src/pages/login/login.ts is part of the declarations of 2 modules: AppModule in C:/ionic/walldo/src/app/app.module.ts and LoginPageModule in C:/ionic/walldo/src/pages/login/login.module.ts! Please consider moving LoginPage in C:/ionic/walldo/src/pages/login/login.ts to a higher module that imports AppModule in C:/ionic/walldo/src/app/app.module.ts and LoginPageModule in C:/ionic/walldo/src/pages/login/login.module.ts. You can also create a new NgModule that exports and includes LoginPage in C:/ionic/walldo/src/pages/login/login.ts then import that NgModule in AppModule in C:/ionic/walldo/src/app/app.module.ts and LoginPageModule in C:/ionic/walldo/src/pages/login/login.module.ts.
at Error (native)
at syntaxError (C:\ionic\walldo\node_modules@angular\compiler\bundles\compiler.umd.js:1729:34)
at CompileMetadataResolver._addTypeToModule (C:\ionic\walldo\node_modules@angular\compiler\bundles\compiler.umd.js:15728:31)
at C:\ionic\walldo\node_modules@angular\compiler\bundles\compiler.umd.js:15616:27
at Array.forEach (native)
at CompileMetadataResolver.getNgModuleMetadata (C:\ionic\walldo\node_modules@angular\compiler\bundles\compiler.umd.js:15607:54)
at addNgModule (C:\ionic\walldo\node_modules@angular\compiler\bundles\compiler.umd.js:24403:58)
at C:\ionic\walldo\node_modules@angular\compiler\bundles\compiler.umd.js:24414:14
at Array.forEach (native)
at _createNgModules (C:\ionic\walldo\node_modules@angular\compiler\bundles\compiler.umd.js:24413:26)

Error displayed when trying to build ionic apk. No problems,when using the app in ionic serve --lab.
Thanks.

I have the same problem, Imagine u have create a new module he’s name is MyImaginyModule, in this module 2 new components
MyFirstComponent, and MySeconComponent
In our module MyImaginyModule.ts we find our two components (MyFirstComponent and MySeconComponent) in declaration like this :
declarations: [
MyFirstComponent,
MySeconComponent
],
If U need to use this module in another module, U must put this two components exports in our module ( MyImaginyModule )
exports: [
MyFirstComponent,
MySeconComponent
]
So in our module MyImaginyModule we have two components declared in declarations and exports,
We put our components in exports: [] when we need to use our logic of this module in another module.
In the final when u have to use our MyImaginyModule u have just to import it ur ur other module

If you want to use a component several times throughout your app you will need to create a shared module for them.

@NgModule({
    imports: [
        CommonModule
     ],
    declarations: [
        Component1,
        Component2,
        Component3....

    ],
    exports: [
        Component1,
        Component2
    ]
})
export class SharedModule {}

After this you simple need to import this into the main app module, within the imports array.

Then in every module or page you wish to use the component in, you simple add it to the imports array in the component.module.ts file.

Hope this helps