Skip to content

Commit ac8afcc

Browse files
committed
fix(ios): only allow IPHONEOS_DEPLOYMENT_TARGET to be explicitly set vs entire xcconfig
1 parent 15289db commit ac8afcc

File tree

3 files changed

+1514
-1101
lines changed

3 files changed

+1514
-1101
lines changed

lib/services/ios/xcodebuild-args-service.ts

+16-5
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
IBuildConfig,
88
IiOSBuildConfig,
99
} from "../../definitions/project";
10+
import { IXcconfigService } from "../../declarations";
1011
import { IPlatformData } from "../../definitions/platform";
1112
import { IFileSystem } from "../../common/declarations";
1213
import { injector } from "../../common/yok";
@@ -21,7 +22,8 @@ export class XcodebuildArgsService implements IXcodebuildArgsService {
2122
private $devicesService: Mobile.IDevicesService,
2223
private $fs: IFileSystem,
2324
private $iOSWatchAppService: IIOSWatchAppService,
24-
private $logger: ILogger
25+
private $logger: ILogger,
26+
private $xcconfigService: IXcconfigService
2527
) {}
2628

2729
public async getBuildForSimulatorArgs(
@@ -131,10 +133,19 @@ export class XcodebuildArgsService implements IXcodebuildArgsService {
131133
platformData.normalizedPlatformName,
132134
constants.BUILD_XCCONFIG_FILE_NAME
133135
);
134-
135-
if (this.$fs.exists(BUILD_SETTINGS_FILE_PATH)) {
136-
extraArgs.push("-xcconfig");
137-
extraArgs.push(BUILD_SETTINGS_FILE_PATH);
136+
// Only include explit deploy target if one is defined
137+
// Note: we could include entire file via -xcconfig flag
138+
// however doing so introduces unwanted side effects
139+
// like cocoapods issues related to ASSETCATALOG_COMPILER_APPICON_NAME
140+
// references: https://medium.com/@iostechset/why-cocoapods-eats-app-icons-79fe729808d4
141+
// https://github.com/CocoaPods/CocoaPods/issues/7003
142+
const deployTargetProperty = "IPHONEOS_DEPLOYMENT_TARGET";
143+
const deployTargetVersion = this.$xcconfigService.readPropertyValue(
144+
BUILD_SETTINGS_FILE_PATH,
145+
deployTargetProperty
146+
);
147+
if (deployTargetVersion) {
148+
extraArgs.push(`${deployTargetProperty}=${deployTargetVersion}`);
138149
}
139150

140151
if (this.$fs.exists(xcworkspacePath)) {

0 commit comments

Comments
 (0)