Skip to content

Commit 0a9ea39

Browse files
tjzelreact-native-bot
authored andcommitted
fix: ignore build/ and DerivedData/ dirs in when reading infoPlistFiles (#51833)
Summary: #49927 introduced a regression where a Ruby script would read compilation artifacts and fail, when the user has relative build directories set in XCode. After successful compilation `build/` dir and `DerivedData/` dir have `.plist` files that aren't in UTF-8 encoding and shouldn't be read by the script. If the user tries to reinstall pods at this point, he gets the following error: ![image](https://github.com/user-attachments/assets/6bd31907-66af-4ea5-b2a6-2847e0ee18e1) This is how you enable relative build directories in XCode. ![Screenshot 2025-06-05 at 11 08 31](https://github.com/user-attachments/assets/22a555b4-a468-481d-8492-02c3b36bfa25) ## Changelog: [IOS] [FIXED] - Ignore `build/` and `DerivedData/` directories when reading `.plist` files. Pull Request resolved: #51833 Test Plan: After applying this patch the problem doesn't occur anymore on my machine. Reviewed By: cortinico Differential Revision: D76030133 Pulled By: cipolleschi fbshipit-source-id: 7ae8c2d0ce28b6925245a9172154e3dcafee126f
1 parent 3d06f9e commit 0a9ea39

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/react-native/scripts/cocoapods/new_architecture.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def self.set_RCTNewArchEnabled_in_info_plist(installer, new_arch_enabled)
161161
.uniq{ |p| p.path }
162162
.map{ |p| p.path }
163163

164-
excluded_info_plist = ["/Pods", "Tests", "metainternal", ".bundle"]
164+
excluded_info_plist = ["/Pods", "Tests", "metainternal", ".bundle", "build/", "DerivedData/"]
165165
projectPaths.each do |projectPath|
166166
projectFolderPath = File.dirname(projectPath)
167167
infoPlistFiles = `find #{projectFolderPath} -name "Info.plist"`

0 commit comments

Comments
 (0)