@@ -467,11 +467,8 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
467
467
}
468
468
469
469
private async isDynamicFramework ( frameworkPath : string ) : Promise < boolean > {
470
- const frameworkName = path . basename (
471
- frameworkPath ,
472
- path . extname ( frameworkPath )
473
- ) ;
474
- const isDynamicFrameworkBundle = async ( bundlePath : string ) => {
470
+
471
+ const isDynamicFrameworkBundle = async ( bundlePath : string , frameworkName : string ) => {
475
472
const frameworkBinaryPath = path . join ( bundlePath , frameworkName ) ;
476
473
477
474
const fileResult = (
@@ -487,25 +484,29 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
487
484
488
485
if ( path . extname ( frameworkPath ) === ".xcframework" ) {
489
486
let isDynamic = true ;
490
- const subDirs = this . $fs
491
- . readDirectory ( frameworkPath )
492
- . filter ( ( entry ) =>
493
- this . $fs . getFsStats ( path . join ( frameworkPath , entry ) ) . isDirectory ( )
494
- ) ;
495
- for ( const subDir of subDirs ) {
487
+ const plistJson = this . $plistParser . parseFileSync ( path . join ( frameworkPath , 'Info.plist' ) ) ;
488
+ for ( const library of plistJson . AvailableLibraries ) {
496
489
const singlePlatformFramework = path . join (
497
- subDir ,
498
- frameworkName + ".framework"
490
+ frameworkPath ,
491
+ library . LibraryIdentifier ,
492
+ library . LibraryPath
499
493
) ;
500
494
if ( this . $fs . exists ( singlePlatformFramework ) ) {
501
- isDynamic = await isDynamicFrameworkBundle ( singlePlatformFramework ) ;
495
+ const frameworkName = path . basename (
496
+ singlePlatformFramework ,
497
+ path . extname ( singlePlatformFramework )
498
+ ) ;
499
+ isDynamic = await isDynamicFrameworkBundle ( singlePlatformFramework , frameworkName ) ;
502
500
break ;
503
501
}
504
502
}
505
-
506
503
return isDynamic ;
507
504
} else {
508
- return await isDynamicFrameworkBundle ( frameworkPath ) ;
505
+ const frameworkName = path . basename (
506
+ frameworkPath ,
507
+ path . extname ( frameworkPath )
508
+ ) ;
509
+ return await isDynamicFrameworkBundle ( frameworkPath , frameworkName ) ;
509
510
}
510
511
}
511
512
@@ -518,7 +519,8 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
518
519
519
520
const project = this . createPbxProj ( projectData ) ;
520
521
const frameworkAddOptions : IXcode . Options = { customFramework : true } ;
521
- if ( await this . isDynamicFramework ( frameworkPath ) ) {
522
+ const dynamic = await this . isDynamicFramework ( frameworkPath ) ;
523
+ if ( dynamic ) {
522
524
frameworkAddOptions [ "embed" ] = true ;
523
525
frameworkAddOptions [ "sign" ] = true ;
524
526
}
0 commit comments