@@ -495,8 +495,6 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
495495 await this . prepareResources ( pluginPlatformsFolderPath , pluginData , projectData ) ;
496496 await this . prepareFrameworks ( pluginPlatformsFolderPath , pluginData , projectData ) ;
497497 await this . prepareStaticLibs ( pluginPlatformsFolderPath , pluginData , projectData ) ;
498- const platformData = this . getPlatformData ( projectData ) ;
499- await this . $cocoapodsService . applyPodfileToProject ( pluginData . name , this . $cocoapodsService . getPluginPodfilePath ( pluginData ) , projectData , platformData ) ;
500498 }
501499
502500 public async removePluginNativeCode ( pluginData : IPluginData , projectData : IProjectData ) : Promise < void > {
@@ -512,8 +510,10 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
512510
513511 public async handleNativeDependenciesChange ( projectData : IProjectData , opts : IRelease ) : Promise < void > {
514512 const platformData = this . getPlatformData ( projectData ) ;
515-
513+ const pluginsData = await this . getAllInstalledPlugins ( projectData ) ;
516514 this . setProductBundleIdentifier ( projectData ) ;
515+
516+ await this . applyPluginsCocoaPods ( pluginsData , projectData , platformData ) ;
517517 await this . $cocoapodsService . applyPodfileFromAppResources ( projectData , platformData ) ;
518518
519519 const projectPodfilePath = this . $cocoapodsService . getProjectPodfilePath ( platformData . projectRoot ) ;
@@ -528,7 +528,7 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
528528
529529 const pbxProjPath = this . getPbxProjPath ( projectData ) ;
530530 this . $iOSExtensionsService . removeExtensions ( { pbxProjPath } ) ;
531- await this . addExtensions ( projectData ) ;
531+ await this . addExtensions ( projectData , pluginsData ) ;
532532 }
533533
534534 public beforePrepareAllPlugins ( ) : Promise < void > {
@@ -641,18 +641,17 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
641641 this . savePbxProj ( project , projectData ) ;
642642 }
643643
644- private async addExtensions ( projectData : IProjectData ) : Promise < void > {
644+ private async addExtensions ( projectData : IProjectData , pluginsData : IPluginData [ ] ) : Promise < void > {
645645 const resorcesExtensionsPath = path . join (
646646 projectData . getAppResourcesDirectoryPath ( ) ,
647647 this . getPlatformData ( projectData ) . normalizedPlatformName , constants . NATIVE_EXTENSION_FOLDER
648648 ) ;
649649 const platformData = this . getPlatformData ( projectData ) ;
650650 const pbxProjPath = this . getPbxProjPath ( projectData ) ;
651651 const addedExtensionsFromResources = await this . $iOSExtensionsService . addExtensionsFromPath ( { extensionsFolderPath : resorcesExtensionsPath , projectData, platformData, pbxProjPath } ) ;
652- const plugins = await this . getAllInstalledPlugins ( projectData ) ;
653652 let addedExtensionsFromPlugins = false ;
654- for ( const pluginIndex in plugins ) {
655- const pluginData = plugins [ pluginIndex ] ;
653+ for ( const pluginIndex in pluginsData ) {
654+ const pluginData = pluginsData [ pluginIndex ] ;
656655 const pluginPlatformsFolderPath = pluginData . pluginPlatformsFolderPath ( IOSProjectService . IOS_PLATFORM_NAME ) ;
657656
658657 const extensionPath = path . join ( pluginPlatformsFolderPath , constants . NATIVE_EXTENSION_FOLDER ) ;
@@ -828,6 +827,15 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
828827 this . $logger . warn ( "[WARNING]: The CFBundleIdentifier key inside the 'Info.plist' will be overriden by the 'id' inside 'package.json'." ) ;
829828 }
830829 }
830+
831+ private async applyPluginsCocoaPods ( pluginsData : IPluginData [ ] , projectData : IProjectData , platformData : IPlatformData ) {
832+ for ( const pluginIndex in pluginsData ) {
833+ const pluginData = pluginsData [ pluginIndex ] ;
834+ if ( this . $fs . exists ( pluginData . pluginPlatformsFolderPath ( platformData . normalizedPlatformName ) ) ) {
835+ await this . $cocoapodsService . applyPodfileToProject ( pluginData . name , this . $cocoapodsService . getPluginPodfilePath ( pluginData ) , projectData , platformData ) ;
836+ }
837+ }
838+ }
831839}
832840
833841$injector . register ( "iOSProjectService" , IOSProjectService ) ;
0 commit comments