From 25bb4f45a9c683d61c7f343fe9787aae03ebe01f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Loureiro?= <175489935+joaoloureirop@users.noreply.github.com> Date: Fri, 6 Sep 2024 13:34:46 +0100 Subject: [PATCH] chore: fix flipper pod compilation with pika 15.3 toolchain (#11080) add pod post install script to include required import see more https://github.com/facebook/flipper/commit/b3dcdb87f930dbbc9dbacb53ad60996e0111e7d8 https://github.com/facebook/react-native/issues/43335#issuecomment-1980708164 NOTE: to install ios pods run `yarn pod:install`. It will execute ` bundle exec pod install --project-directory=ios` within the project root directory. Running `pod install` inside `ios` folder will error out --- ios/Podfile | 17 ++++++++++++++++- package.json | 2 +- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/ios/Podfile b/ios/Podfile index a4506c47e9b..d9ae91f6b43 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -116,11 +116,26 @@ target 'MetaMask-Flask' do end post_install do |installer| + # fix flipper with pika 15.3 toolchain + installer.pods_project.targets.each do |target| + if target.name == 'Flipper' + file_path = 'ios/Pods/Flipper/xplat/Flipper/FlipperTransportTypes.h' + system("chmod +w " + file_path) + contents = File.read(file_path) + unless contents.include?('#include ') + File.open(file_path, 'w') do |file| + file.puts('#include ') + file.puts(contents) + end + end + end + end + react_native_post_install( installer, # Set `mac_catalyst_enabled` to `true` in order to apply patches # necessary for Mac Catalyst builds :mac_catalyst_enabled => false - ) + ) __apply_Xcode_12_5_M1_post_install_workaround(installer) end diff --git a/package.json b/package.json index dee03892f2c..e0d5ddcb0be 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "watch": "./scripts/build.sh watcher watch", "watch:clean": "./scripts/build.sh watcher clean", "clean:ios": "rm -rf ios/build", - "pod:install": "command -v pod && (cd ios/ && bundle exec pod install && cd ..) || echo \"Skipping pod install\"", + "pod:install": "command -v pod && bundle exec pod install --project-directory=ios || echo \"pod command not found. Skipping pod install\"", "clean:ppom": "rm -rf ppom/dist ppom/node_modules app/lib/ppom/ppom.html.js", "clean:android": "rm -rf android/app/build", "clean:node": "rm -rf node_modules && yarn --frozen-lockfile",