@@ -715,8 +715,9 @@ export class PlatformService extends EventEmitter implements IPlatformService {
715715 let requiresNativePlatformAdd = false ;
716716
717717 const platformData = this . $platformsData . getPlatformData ( platform , projectData ) ;
718+ const prepareInfo = this . $projectChangesService . getPrepareInfo ( platform , projectData ) ;
718719 // In case when no platform is added and webpack plugin is started it produces files in platforms folder. In this case {N} CLI needs to add platform and keeps the already produced files from webpack
719- if ( ! this . $fs . exists ( platformData . configurationFilePath ) && this . isPlatformInstalled ( platform , projectData ) && appFilesUpdaterOptions . bundle ) {
720+ if ( appFilesUpdaterOptions . bundle && this . isPlatformInstalled ( platform , projectData ) && ! this . $fs . exists ( platformData . configurationFilePath ) && prepareInfo . nativePlatformStatus !== constants . NativePlatformStatus . alreadyPrepared ) {
720721 const tmpDirectoryPath = path . join ( projectData . projectDir , "platforms" , "tmp" ) ;
721722 this . $fs . deleteDirectory ( tmpDirectoryPath ) ;
722723 this . $fs . ensureDirectoryExists ( tmpDirectoryPath ) ;
@@ -731,7 +732,6 @@ export class PlatformService extends EventEmitter implements IPlatformService {
731732 await this . addPlatform ( platform , platformTemplate , projectData , config , "" , nativePrepare ) ;
732733 } else {
733734 const shouldAddNativePlatform = ! nativePrepare || ! nativePrepare . skipNativePrepare ;
734- const prepareInfo = this . $projectChangesService . getPrepareInfo ( platform , projectData ) ;
735735 // In case there's no prepare info, it means only platform add had been executed. So we've come from CLI and we do not need to prepare natively.
736736 requiresNativePlatformAdd = prepareInfo && prepareInfo . nativePlatformStatus === constants . NativePlatformStatus . requiresPlatformAdd ;
737737 if ( requiresNativePlatformAdd && shouldAddNativePlatform ) {
0 commit comments