From bd7c6e8539d3f81bcef700fb8b89c6fa16453dcf Mon Sep 17 00:00:00 2001 From: Hirbod <504909+hirbod@users.noreply.github.com> Date: Sun, 12 Nov 2023 23:10:35 +0100 Subject: [PATCH] fix: Apple silicon simulator builds (#2524) --- apps/expo/app.config.ts | 2 - .../plugins/with-hermes-ios-m1-workaround.js | 44 ------------------- apps/expo/plugins/with-spotify-sdk.js | 23 ---------- 3 files changed, 69 deletions(-) delete mode 100644 apps/expo/plugins/with-hermes-ios-m1-workaround.js delete mode 100644 apps/expo/plugins/with-spotify-sdk.js diff --git a/apps/expo/app.config.ts b/apps/expo/app.config.ts index ec6f555eb3..a09c4266f7 100644 --- a/apps/expo/app.config.ts +++ b/apps/expo/app.config.ts @@ -189,9 +189,7 @@ const expoConfig: ExpoConfig = { }, ], "./plugins/with-android-manifest.js", - "./plugins/with-hermes-ios-m1-workaround.js", "sentry-expo", - "./plugins/with-spotify-sdk.js", "./plugins/with-android-splash-screen.js", "./plugins/with-disabled-force-dark-mode.js", [ diff --git a/apps/expo/plugins/with-hermes-ios-m1-workaround.js b/apps/expo/plugins/with-hermes-ios-m1-workaround.js deleted file mode 100644 index c5d35a295e..0000000000 --- a/apps/expo/plugins/with-hermes-ios-m1-workaround.js +++ /dev/null @@ -1,44 +0,0 @@ -const { withDangerousMod } = require("@expo/config-plugins"); -const path = require("path"); -const fs = require("fs"); - -function withNewPodfile(config) { - return withDangerousMod(config, [ - "ios", - async (c) => { - const filePath = path.join(c.modRequest.platformProjectRoot, "Podfile"); - const contents = fs.readFileSync(filePath, "utf-8"); - - const results = contents.includes( - "# Workaround simulator build error for hermes with react-native 0.64 on mac m1 devices" - ) - ? contents - : contents.replace( - "__apply_Xcode_12_5_M1_post_install_workaround(installer)", - `__apply_Xcode_12_5_M1_post_install_workaround(installer) - - # Workaround simulator build error for hermes with react-native 0.64 on mac m1 devices - arm_value = \`/usr/sbin/sysctl -n hw.optional.arm64 2>&1\`.to_i - if arm_value == 1 - projects = installer.aggregate_targets - .map{ |t| t.user_project } - .uniq{ |p| p.path } - .push(installer.pods_project) - projects.each do |project| - project.build_configurations.each do |config| - config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] + ' arm64' - end - project.save() - end - end` - ); - fs.writeFileSync(filePath, results); - - return c; - }, - ]); -} - -module.exports = (config) => { - return withNewPodfile(config); -}; diff --git a/apps/expo/plugins/with-spotify-sdk.js b/apps/expo/plugins/with-spotify-sdk.js deleted file mode 100644 index 3834ad4494..0000000000 --- a/apps/expo/plugins/with-spotify-sdk.js +++ /dev/null @@ -1,23 +0,0 @@ -const { withAppBuildGradle } = require("@expo/config-plugins"); - -function withCustomAppBuildGradle(config) { - const insertString = ` manifestPlaceholders = [redirectSchemeName: "io.showtime", redirectHostName: "spotify-success" ]`; - - return withAppBuildGradle(config, (config) => { - if (config.modResults.contents.includes(insertString)) { - return config; - } - config.modResults.contents = config.modResults.contents.replace( - `defaultConfig {`, - `defaultConfig { - ${insertString}` - ); - - return config; - }); -} - -module.exports = function withSpotifySDK(config) { - config = withCustomAppBuildGradle(config); - return config; -};