From f81fc0a16eb6d64a138d1d6b73ce790bf2b31651 Mon Sep 17 00:00:00 2001 From: Christian Falch Date: Mon, 10 Nov 2025 06:37:27 -0800 Subject: [PATCH] fix wrong symbolication mapping (#54470) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: When RCT_SYMBOLICATE_PREBUILT_FRAMEWORKS is enabled, source file paths in dSYMs were incorrectly resolved with extra path segments: double node_modules (e.g., /path/node_modules/node_modules/...) The root cause was using File.expand_path(@react_native_path) without the correct base directory. The path was first expanded without a base (causing double node_modules), then fixed to use project_pods_root (ios/Pods/), which still resulted in incorrect paths with an extra ios/ folder. Fixed by expanding the path relative to Pod::Config.instance.installation_root, which correctly points to the ios/ directory, allowing relative paths like ../node_modules/react-native to resolve properly to the project root's node_modules directory. ## Changelog: [IOS] [FIXED] - Fix incorrect source path resolution in dSYM remapping in precompiled framework scripts Pull Request resolved: https://github.com/facebook/react-native/pull/54470 Test Plan: ``` rm -rf ./Pods pod cache clean --all RCT_USE_RN_DEP=1 RCT_USE_PREBUILT_RNCORE=1 RCT_SYMBOLICATE_PREBUILT_FRAMEWORKS=1 bundle exec pod install ``` ✅ Tested with RN-Tester ✅ Tested in 0.83.rc0 project Reviewed By: huntie Differential Revision: D86667786 Pulled By: cipolleschi fbshipit-source-id: cd6279d02d5ed7188e282e4491c05de35f17a8f1 --- packages/react-native/scripts/cocoapods/rncore.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/react-native/scripts/cocoapods/rncore.rb b/packages/react-native/scripts/cocoapods/rncore.rb index b8d3905d73d..a048834c20e 100644 --- a/packages/react-native/scripts/cocoapods/rncore.rb +++ b/packages/react-native/scripts/cocoapods/rncore.rb @@ -271,9 +271,10 @@ class ReactNativeCoreUtils return if dsym_bundles.empty? # Define source path mappings - from absolute build paths to relative framework paths + # Expand the path relative to the installation root (project root, parent of ios/) + react_native_absolute_path = File.expand_path(@@react_native_path, Pod::Config.instance.installation_root) mappings = [ - # Make sure to make react_native_path absolute - ["/Users/runner/work/react-native/react-native/packages/react-native", "#{File.expand_path(@@react_native_path)}"], + ["/Users/runner/work/react-native/react-native/packages/react-native", react_native_absolute_path], ] dsym_bundles.each do |dsym_path| begin