@@ -571,19 +571,21 @@ export class PlatformService implements IPlatformService {
571571 this . $logger . info ( `Copied file '${ packageFile } ' to '${ targetPath } '.` ) ;
572572 }
573573
574- public removePlatforms ( platforms : string [ ] ) : void {
574+ public async removePlatforms ( platforms : string [ ] ) : Promise < void > {
575575 this . $projectDataService . initialize ( this . $projectData . projectDir ) ;
576576
577- _ . each ( platforms , platform => {
577+ for ( let platform of platforms ) {
578578 this . validatePlatformInstalled ( platform ) ;
579579 let platformData = this . $platformsData . getPlatformData ( platform ) ;
580580
581+ await this . $platformsData . getPlatformData ( platform ) . platformProjectService . stopServices ( ) ;
582+
581583 let platformDir = path . join ( this . $projectData . platformsDir , platform ) ;
582584 this . $fs . deleteDirectory ( platformDir ) ;
583585 this . $projectDataService . removeProperty ( platformData . frameworkPackageName ) ;
584586
585587 this . $logger . out ( `Platform ${ platform } successfully removed.` ) ;
586- } ) ;
588+ }
587589 }
588590
589591 public async updatePlatforms ( platforms : string [ ] ) : Promise < void > {
@@ -745,7 +747,7 @@ export class PlatformService implements IPlatformService {
745747
746748 private async updatePlatformCore ( platformData : IPlatformData , currentVersion : string , newVersion : string , canUpdate : boolean ) : Promise < void > {
747749 let packageName = platformData . normalizedPlatformName . toLowerCase ( ) ;
748- this . removePlatforms ( [ packageName ] ) ;
750+ await this . removePlatforms ( [ packageName ] ) ;
749751 packageName = newVersion ? `${ packageName } @${ newVersion } ` : packageName ;
750752 await this . addPlatform ( packageName ) ;
751753 this . $logger . out ( "Successfully updated to version " , newVersion ) ;
0 commit comments