From 78e97a04531e47afa4e0544222d5e17db4fc016a Mon Sep 17 00:00:00 2001 From: Ty Rauber Date: Wed, 28 Feb 2024 09:53:43 +0100 Subject: [PATCH] Fix: Duplicated Signature issue with Xcode 15 (#238) - chore: update changelog - fix: withoutSignatures should effect all builds --- CHANGELOG.md | 1 + plugin/src/withMapLibre.ts | 26 ++++++++++++++++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e413ffe72..c2bed0497 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ Please add unreleased changes in the following style: PR Title ([#123](link to my pr)) ``` +Fix: Duplicated Signature issue with Xcode 15 ([#238](https://github.com/maplibre/maplibre-react-native/pull/238)) Update react-maplibre ([#34](https://github.com/maplibre/maplibre-react-native/issues/34)) chore: update support libraries ([#121](https://github.com/maplibre/maplibre-react-native/pull/121)). diff --git a/plugin/src/withMapLibre.ts b/plugin/src/withMapLibre.ts index ccea3ea15..fc5b2c217 100644 --- a/plugin/src/withMapLibre.ts +++ b/plugin/src/withMapLibre.ts @@ -127,10 +127,32 @@ export function setExcludedArchitectures(project: XcodeProject): XcodeProject { buildSettings['"EXCLUDED_ARCHS[sdk=iphonesimulator*]"'] = '"arm64"'; } } - return project; } +const withoutSignatures: ConfigPlugin = config => { + const shellScript = `if [ "$XCODE_VERSION_MAJOR" = "1500" ]; then + echo "Remove signature files (Xcode 15 workaround)"; + rm -rf "$CONFIGURATION_BUILD_DIR/Mapbox.xcframework-ios.signature"; + fi`; + return withXcodeProject(config, async config => { + const xcodeProject = config.modResults; + + xcodeProject.addBuildPhase( + [], + 'PBXShellScriptBuildPhase', + 'Remove signature files (Xcode 15 workaround)', + null, + { + shellPath: '/bin/sh', + shellScript, + }, + ); + + return config; + }); +}; + const withExcludedSimulatorArchitectures: ConfigPlugin = c => { return withXcodeProject(c, config => { config.modResults = setExcludedArchitectures(config.modResults); @@ -139,7 +161,7 @@ const withExcludedSimulatorArchitectures: ConfigPlugin = c => { }; const withMapLibre: ConfigPlugin = config => { - config = withExcludedSimulatorArchitectures(config); + config = withoutSignatures(withExcludedSimulatorArchitectures(config)); return withCocoaPodsInstallerBlocks(config); };