@@ -571,19 +571,21 @@ export class PlatformService implements IPlatformService {
571
571
this . $logger . info ( `Copied file '${ packageFile } ' to '${ targetPath } '.` ) ;
572
572
}
573
573
574
- public removePlatforms ( platforms : string [ ] ) : void {
574
+ public async removePlatforms ( platforms : string [ ] ) : Promise < void > {
575
575
this . $projectDataService . initialize ( this . $projectData . projectDir ) ;
576
576
577
- _ . each ( platforms , platform => {
577
+ for ( let platform of platforms ) {
578
578
this . validatePlatformInstalled ( platform ) ;
579
579
let platformData = this . $platformsData . getPlatformData ( platform ) ;
580
580
581
+ await this . $platformsData . getPlatformData ( platform ) . platformProjectService . stopServices ( ) ;
582
+
581
583
let platformDir = path . join ( this . $projectData . platformsDir , platform ) ;
582
584
this . $fs . deleteDirectory ( platformDir ) ;
583
585
this . $projectDataService . removeProperty ( platformData . frameworkPackageName ) ;
584
586
585
587
this . $logger . out ( `Platform ${ platform } successfully removed.` ) ;
586
- } ) ;
588
+ }
587
589
}
588
590
589
591
public async updatePlatforms ( platforms : string [ ] ) : Promise < void > {
@@ -745,7 +747,7 @@ export class PlatformService implements IPlatformService {
745
747
746
748
private async updatePlatformCore ( platformData : IPlatformData , currentVersion : string , newVersion : string , canUpdate : boolean ) : Promise < void > {
747
749
let packageName = platformData . normalizedPlatformName . toLowerCase ( ) ;
748
- this . removePlatforms ( [ packageName ] ) ;
750
+ await this . removePlatforms ( [ packageName ] ) ;
749
751
packageName = newVersion ? `${ packageName } @${ newVersion } ` : packageName ;
750
752
await this . addPlatform ( packageName ) ;
751
753
this . $logger . out ( "Successfully updated to version " , newVersion ) ;
0 commit comments