Skip to content

fix(ios): correctly link non dynamic frameworks #5744

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 17 additions & 16 deletions lib/services/ios-project-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -468,11 +468,8 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
}

private async isDynamicFramework(frameworkPath: string): Promise<boolean> {
const frameworkName = path.basename(
frameworkPath,
path.extname(frameworkPath)
);
const isDynamicFrameworkBundle = async (bundlePath: string) => {

const isDynamicFrameworkBundle = async (bundlePath: string, frameworkName: string) => {
const frameworkBinaryPath = path.join(bundlePath, frameworkName);

const fileResult = (
Expand All @@ -488,25 +485,29 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ

if (path.extname(frameworkPath) === ".xcframework") {
let isDynamic = true;
const subDirs = this.$fs
.readDirectory(frameworkPath)
.filter((entry) =>
this.$fs.getFsStats(path.join(frameworkPath, entry)).isDirectory()
);
for (const subDir of subDirs) {
const plistJson = this.$plistParser.parseFileSync(path.join(frameworkPath, 'Info.plist'));
for (const library of plistJson.AvailableLibraries) {
const singlePlatformFramework = path.join(
subDir,
frameworkName + ".framework"
frameworkPath,
library.LibraryIdentifier,
library.LibraryPath
);
if (this.$fs.exists(singlePlatformFramework)) {
isDynamic = await isDynamicFrameworkBundle(singlePlatformFramework);
const frameworkName = path.basename(
singlePlatformFramework,
path.extname(singlePlatformFramework)
);
isDynamic = await isDynamicFrameworkBundle(singlePlatformFramework, frameworkName);
break;
}
}

return isDynamic;
} else {
return await isDynamicFrameworkBundle(frameworkPath);
const frameworkName = path.basename(
frameworkPath,
path.extname(frameworkPath)
);
return await isDynamicFrameworkBundle(frameworkPath, frameworkName);
}
}

Expand Down