diff --git a/lib/common b/lib/common index 0a906cdc0c..a53bd014d5 160000 --- a/lib/common +++ b/lib/common @@ -1 +1 @@ -Subproject commit 0a906cdc0ca944811229636db1715c429f0de9c6 +Subproject commit a53bd014d553ac1203362ea3bc1fe00861cf9548 diff --git a/lib/services/ios-project-service.ts b/lib/services/ios-project-service.ts index 1e11cf10d2..ea36dcad89 100644 --- a/lib/services/ios-project-service.ts +++ b/lib/services/ios-project-service.ts @@ -1301,6 +1301,13 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f await this.mergeXcconfigFiles(appResourcesXcconfigPath, pluginsXcconfigFilePath); } + if (!this.$fs.exists(pluginsXcconfigFilePath)) { + // We need the pluginsXcconfig file to exist in platforms dir as it is required in the native template: + // https://github.com/NativeScript/ios-runtime/blob/9c2b7b5f70b9bee8452b7a24aa6b646214c7d2be/build/project-template/__PROJECT_NAME__/build-debug.xcconfig#L3 + // From Xcode 10 in case the file is missing, this include fails and the build itself fails (was a warning in previous Xcode versions). + this.$fs.writeFile(pluginsXcconfigFilePath, ""); + } + // Set Entitlements Property to point to default file if not set explicitly by the user. const entitlementsPropertyValue = this.$xCConfigService.readPropertyValue(pluginsXcconfigFilePath, constants.CODE_SIGN_ENTITLEMENTS); if (entitlementsPropertyValue === null && this.$fs.exists(this.$iOSEntitlementsService.getPlatformsEntitlementsPath(projectData))) { diff --git a/test/ios-project-service.ts b/test/ios-project-service.ts index e65ffd51bb..9ff67d7c50 100644 --- a/test/ios-project-service.ts +++ b/test/ios-project-service.ts @@ -1029,4 +1029,18 @@ describe("Merge Project XCConfig files", () => { assertPropertyValues(expected, destinationFilePath, testInjector); } }); + + it("creates empty plugins-.xcconfig in case there are no build.xcconfig in App_Resources and in plugins", async () => { + // run merge for all release: debug|release + for (const release in [true, false]) { + await (iOSProjectService).mergeProjectXcconfigFiles(release, projectData); + + const destinationFilePath = release ? (iOSProjectService).getPluginsReleaseXcconfigFilePath(projectData) + : (iOSProjectService).getPluginsDebugXcconfigFilePath(projectData); + + assert.isTrue(fs.exists(destinationFilePath), 'Target build xcconfig is missing for release: ' + release); + const content = fs.readFile(destinationFilePath).toString(); + assert.equal(content, ""); + } + }); });