@@ -715,8 +715,9 @@ export class PlatformService extends EventEmitter implements IPlatformService {
715
715
let requiresNativePlatformAdd = false ;
716
716
717
717
const platformData = this . $platformsData . getPlatformData ( platform , projectData ) ;
718
+ const prepareInfo = this . $projectChangesService . getPrepareInfo ( platform , projectData ) ;
718
719
// 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 ) {
720
721
const tmpDirectoryPath = path . join ( projectData . projectDir , "platforms" , "tmp" ) ;
721
722
this . $fs . deleteDirectory ( tmpDirectoryPath ) ;
722
723
this . $fs . ensureDirectoryExists ( tmpDirectoryPath ) ;
@@ -731,7 +732,6 @@ export class PlatformService extends EventEmitter implements IPlatformService {
731
732
await this . addPlatform ( platform , platformTemplate , projectData , config , "" , nativePrepare ) ;
732
733
} else {
733
734
const shouldAddNativePlatform = ! nativePrepare || ! nativePrepare . skipNativePrepare ;
734
- const prepareInfo = this . $projectChangesService . getPrepareInfo ( platform , projectData ) ;
735
735
// 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.
736
736
requiresNativePlatformAdd = prepareInfo && prepareInfo . nativePlatformStatus === constants . NativePlatformStatus . requiresPlatformAdd ;
737
737
if ( requiresNativePlatformAdd && shouldAddNativePlatform ) {
0 commit comments