Skip to content

[🐛] Bug Report Title - Multiple commands produce error due to duplicate copy of ScopedShadowTreeRevisionLock.h #8476

Open
@ABogdanovas

Description

@ABogdanovas

Issue

I'm encountering a build failure on iOS when trying to compile my React Native project with @react-native-firebase modules installed. The error points to a duplicate copy command for the file ScopedShadowTreeRevisionLock.h, specifically from targets React-Fabric and React-rendererconsistency.

Multiple commands produce '/Users/.../Library/Developer/Xcode/DerivedData/driverapp-bdzjbubssrkxnodvkzzofvxausck/Build/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@react-native-community+cli@1_crwjwnw4p4u62bhybwdnt3idjq/node_modules/react-native/ReactCommon/react/renderer/consistency/ScopedShadowTreeRevisionLock.h'

Target 'React-Fabric' (project 'Pods') has copy command from '/Users/.../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@react-native-community+cli@1_crwjwnw4p4u62bhybwdnt3idjq/node_modules/react-native/ReactCommon/react/renderer/consistency/ScopedShadowTreeRevisionLock.h' to '/Users/aleksandrbogdanov/Library/Developer/Xcode/DerivedData/driverapp-bdzjbubssrkxnodvkzzofvxausck/Build/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@react-native-community+cli@1_crwjwnw4p4u62bhybwdnt3idjq/node_modules/react-native/ReactCommon/react/renderer/consistency/ScopedShadowTreeRevisionLock.h'

Target 'React-rendererconsistency' (project 'Pods') has copy command from '/Users/.../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@react-native-community+cli@1_crwjwnw4p4u62bhybwdnt3idjq/node_modules/react-native/ReactCommon/react/renderer/consistency/ScopedShadowTreeRevisionLock.h' to '/Users/.../Library/Developer/Xcode/DerivedData/driverapp-bdzjbubssrkxnodvkzzofvxausck/Build/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@react-native-community+cli@1_crwjwnw4p4u62bhybwdnt3idjq/node_modules/react-native/ReactCommon/react/renderer/consistency/ScopedShadowTreeRevisionLock.h'

Project Files

Javascript

Click To Expand

package.json:

# N/A

firebase.json for react-native-firebase v6:

...
"@react-native-firebase/app": "20.5.0",
"@react-native-firebase/crashlytics": "20.5.0",
"@react-native-firebase/messaging": "20.5.0",
"react-native": "0.78.2"
...

iOS

Click To Expand

ios/Podfile:

  • I'm not using Pods
  • I'm using Pods and my Podfile looks like:
# Resolve react_native_pods.rb with node to allow for hoisting
require Pod::Executable.execute_command('node', ['-p',
  'require.resolve(
    "react-native/scripts/react_native_pods.rb",
    {paths: [process.argv[1]]},
  )', __dir__]).strip

platform :ios, 15.1
prepare_react_native_project!

use_frameworks! :linkage => :static

$RNFirebaseAsStaticFramework = true

target 'driverapp' do
  config = use_native_modules!

  rn_maps_path = '../node_modules/react-native-maps'
  pod 'react-native-google-maps', :path => rn_maps_path


  use_react_native!(
    :path => config[:reactNativePath],
    # An absolute path to your application root.
    :app_path => "#{Pod::Config.instance.installation_root}/.."
  )

  post_install do |installer|
    # https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202
    react_native_post_install(
      installer,
      config[:reactNativePath],
      :mac_catalyst_enabled => false,
      # :ccache_enabled => true
    )
  end
end

source 'https://rubygems.org'

# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby ">= 2.6.10"

# Exclude problematic versions of cocoapods and activesupport that causes build failures.
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
gem 'xcodeproj', '< 1.26.0'
gem 'concurrent-ruby', '< 1.3.4'
gem 'cocoapods-user-defined-build-types'

AppDelegate.swift:

import UIKit
import React
import React_RCTAppDelegate
import ReactAppDependencyProvider
import Firebase

@main
class AppDelegate: RCTAppDelegate {
  override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
    self.moduleName = "driverapp"
    self.dependencyProvider = RCTAppDependencyProvider()

    // You can add your custom initial props in the dictionary below.
    // They will be passed down to the ViewController used by React Native.
    self.initialProps = [:]

    FirebaseApp.configure()

    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
  }

  override func sourceURL(for bridge: RCTBridge) -> URL? {
    self.bundleURL()
  }

  override func bundleURL() -> URL? {
#if DEBUG
    RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index")
#else
    Bundle.main.url(forResource: "main", withExtension: "jsbundle")
#endif
  }
}


Android

Click To Expand

Have you converted to AndroidX?

  • my application is an AndroidX application?
  • I am using android/gradle.settings jetifier=true for Android compatibility?
  • I am using the NPM package jetifier for react-native compatibility?

android/build.gradle:

// N/A

android/app/build.gradle:

// N/A

android/settings.gradle:

// N/A

MainApplication.java:

// N/A

AndroidManifest.xml:

<!-- N/A -->


Environment

Click To Expand

react-native info output:

 System:
  OS: macOS 15.3.2
  CPU: (12) arm64 Apple M2 Pro
  Memory: 100.41 MB / 32.00 GB
  Shell:
    version: 3.2.57
    path: /bin/bash
Binaries:
  Node:
    version: 22.14.0
    path: ~/.local/state/fnm_multishells/10161_1744810000525/bin/node
  Yarn: Not Found
  npm:
    version: 10.9.2
    path: ~/.local/state/fnm_multishells/10161_1744810000525/bin/npm
  Watchman:
    version: 2024.12.02.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /Users/aleksandrbogdanov/.rbenv/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.4
      - iOS 18.4
      - macOS 15.4
      - tvOS 18.4
      - visionOS 2.4
      - watchOS 11.4
  Android SDK: Not Found
IDEs:
  Android Studio: 2024.1 AI-241.18034.62.2411.12071903
  Xcode:
    version: 16.3/16E140
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 19.0.2
    path: /usr/bin/javac
  Ruby:
    version: 2.7.2
    path: /Users/aleksandrbogdanov/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 15.0.1
    wanted: ^15.0.1
  react:
    installed: 19.0.0
    wanted: ^19.0.0
  react-native:
    installed: 0.78.2
    wanted: ^0.78.2
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true
  • Platform that you're experiencing the issue on:
    • iOS
    • Android
    • iOS but have not tested behavior on Android
    • Android but have not tested behavior on iOS
    • Both
  • react-native-firebase version you're using that has this issue:
    • 20.5.0
  • Firebase module(s) you're using that has the issue:
    • e.g. Instance ID
  • Are you using TypeScript?
    • Y & 5.6.3


Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions