Skip to content

Commit 7e2e61e

Browse files
committed
[ios][precompile] fix wrong symbolication mapping
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.
1 parent 45024a5 commit 7e2e61e

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

  • packages/react-native/scripts/cocoapods

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,10 @@ def self.remap_sourcemaps_for_symbols(symbolsPath)
271271
return if dsym_bundles.empty?
272272

273273
# Define source path mappings - from absolute build paths to relative framework paths
274+
# Expand the path relative to the installation root (project root, parent of ios/)
275+
react_native_absolute_path = File.expand_path(@@react_native_path, Pod::Config.instance.installation_root)
274276
mappings = [
275-
# Make sure to make react_native_path absolute
276-
["/Users/runner/work/react-native/react-native/packages/react-native", "#{File.expand_path(@@react_native_path)}"],
277+
["/Users/runner/work/react-native/react-native/packages/react-native", react_native_absolute_path],
277278
]
278279

279280
dsym_bundles.each do |dsym_path| begin

0 commit comments

Comments
 (0)