diff --git a/lib/services/ios-project-service.ts b/lib/services/ios-project-service.ts index d098b6debb..71e5316285 100644 --- a/lib/services/ios-project-service.ts +++ b/lib/services/ios-project-service.ts @@ -674,7 +674,7 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f } private getLibSubpathRelativeToProjectPath(targetPath: string): string { - let frameworkPath = path.relative("platforms/ios", targetPath); + let frameworkPath = path.relative(this.platformData.projectRoot, targetPath); return frameworkPath; } diff --git a/test/ios-project-service.ts b/test/ios-project-service.ts index 9e3878aec3..b9adef3fc8 100644 --- a/test/ios-project-service.ts +++ b/test/ios-project-service.ts @@ -469,13 +469,13 @@ describe("Relative paths", () => { it("checks for correct calculation of relative paths", () => { let projectName = "projectDirectory"; let projectPath = temp.mkdirSync(projectName); - let subpath = "sub/path"; + let subpath = path.join(projectPath, "sub/path"); let testInjector = createTestInjector(projectPath, projectName); createPackageJson(testInjector, projectPath, projectName); let iOSProjectService = testInjector.resolve("iOSProjectService"); let result = iOSProjectService.getLibSubpathRelativeToProjectPath(subpath); - assert.equal(result, path.join("../../", subpath)); + assert.equal(result, "../../sub/path"); }); });