melwinVincent / ionic4-star-rating

Star Rating component for ionic-4 projects
23 stars 11 forks source link

Problem when try to build production android #5

Closed togro closed 4 years ago

togro commented 4 years ago

All works fine on development enviroment or when i generate developer apk .

But when execute build production apk I receive this error :

ERROR in : Type StarRating in /Users/mtoro/GitHub/MGVideoReport/node_modules/ionic4-star-rating/dist/components/ionic4-star-rating-component.d.ts is part of the declarations of 2 modules: SharedStarRating in /Users/mtoro/GitHub/MGVideoReport/src/app/app.sharedrating.module.ts and StarRatingModule in /Users/mtoro/GitHub/MGVideoReport/node_modules/ionic4-star-rating/dist/ionic4-star-rating.module.d.ts! Please consider moving StarRating in /Users/mtoro/GitHub/MGVideoReport/node_modules/ionic4-star-rating/dist/components/ionic4-star-rating-component.d.ts to a higher module that imports SharedStarRating in /Users/mtoro/GitHub/MGVideoReport/src/app/app.sharedrating.module.ts and StarRatingModule in /Users/mtoro/GitHub/MGVideoReport/node_modules/ionic4-star-rating/dist/ionic4-star-rating.module.d.ts. You can also create a new NgModule that exports and includes StarRating in /Users/mtoro/GitHub/MGVideoReport/node_modules/ionic4-star-rating/dist/components/ionic4-star-rating-component.d.ts then import that NgModule in SharedStarRating in /Users/mtoro/GitHub/MGVideoReport/src/app/app.sharedrating.module.ts and StarRatingModule in /Users/mtoro/GitHub/MGVideoReport/node_modules/ionic4-star-rating/dist/ionic4-star-rating.module.d.ts.

[ERROR] An error occurred while running subprocess ng.

togro commented 4 years ago

On file index.d.ts from directory node_modules/ionic4-star-rating/dist have 2 lines :

//export * from './ionic4-star-rating.module';
export * from './components/ionic4-star-rating-component';

I comment first and works fine the generation of APK with --prod .

I'dont know why , but works for me commet that line .

melwinVincent commented 4 years ago

@togro This is not the right solution.

I have fixed the issue and updated the package in npm. Please download the latest npm i ionic4-star-rating@1.1.1

Please upgrade the component and confirm.

Instead of using sharedmodule.ts, you may directly import StarRatingModule in parent-component.module.ts

Please follow the latest docs. I'm attaching the screenshot of the relevant step here

Capture

togro commented 4 years ago

Thanks ! , now is working without that