0
votes

i can build my ionic project with "ionic cordova build android" but the app runs slowly on the device. After some research i learnt it should be built with "ionic cordova build android --prod" to increase the performance. however this is the error i get when i run "ionic cordova build android --prod"

Type PinnedmessagesComponent in project/src/components/pinnedmessages/pinnedmessages.ts is part of the declarations of 2 modules: 

ComponentsModule in project/src/components/components.module.ts and
        ProfilePageModule in project/src/pages/profile/profile.module.ts! 

Please consider moving PinnedmessagesComponent in project/src/components/pinnedmessages/pinnedmessages.ts to a higher module that imports ComponentsModule in project/src/components/components.module.ts and 
ProfilePageModule in project/src/pages/profile/profile.module.ts. 

You can also create a new NgModule that exports and includes PinnedmessagesComponent in project/src/components/pinnedmessages/pinnedmessages.ts then import that NgModule in ComponentsModule in project/src/components/components.module.ts and 
ProfilePageModule in project/src/pages/profile/profile.module.ts.

Pinnedmessages is a component that i created and i use it in another page called ProfilePage. Please tell me how i can solve this. Thanks

1

1 Answers

0
votes

The error tells you what it wants. Create a module for that component and then include that module where you need the component. It doesn't like that you have two component declarations so it wants you to have one in a module and then import that module instead.