'Multiple commands produce' error when building with new Xcode build system

See original GitHub issue

Hello,

Environment:

React Native Environment Info:
    System OS: macOS High Sierra 10.13.6
    Binaries:
      Node: 8.11.3 - /usr/local/bin/node
      npm: 5.6.0 - /usr/local/bin/npm
    IDEs:
      Xcode: 10 Beta 3
    npmPackages:
      react: 16.4.1
      react-native: 0.56.0

Error:

I got the following error when I try to build the simple RN 0.56 application:

warning: Skipping duplicate build file in Compile Sources build phase: <PATH_TO_PROJECT>/node_modules/react-native/React/Modules/RCTRedBoxExtraDataViewController.m (in target 'React-tvOS')
...
warning: duplicate output file '<HOME>/Library/Developer/Xcode/DerivedData/ReactNativeSimple-dpupkkuvhsslwxgngxzqgwsrazap/Build/Intermediates.noindex/ArchiveIntermediates/ReactNativeSimple/BuildProductsPath/Release-iphoneos/include/React/RCTResizeMode.h' on task: PBXCp <PATH_TO_PROJECT>/node_modules/react-native/Libraries/Image/RCTResizeMode.h <HOME>/Library/Developer/Xcode/DerivedData/ReactNativeSimple-dpupkkuvhsslwxgngxzqgwsrazap/Build/Intermediates.noindex/ArchiveIntermediates/ReactNativeSimple/BuildProductsPath/Release-iphoneos/include/React/RCTResizeMode.h (in target 'React')
...
error: Multiple commands produce '<PbxCp <HOME>/Library/Developer/Xcode/DerivedData/ReactNativeSimple-dpupkkuvhsslwxgngxzqgwsrazap/Build/Intermediates.noindex/ArchiveIntermediates/ReactNativeSimple/BuildProductsPath/Release-iphoneos/include/React/RCTScrollableProtocol.h>':
1) Target 'React-tvOS' has copy command from '<PATH_TO_PROJECT>/node_modules/react-native/React/Views/ScrollView/RCTScrollableProtocol.h' to '<HOME>/Library/Developer/Xcode/DerivedData/ReactNativeSimple-dpupkkuvhsslwxgngxzqgwsrazap/Build/Intermediates.noindex/ArchiveIntermediates/ReactNativeSimple/BuildProductsPath/Release-iphoneos/include/React/RCTScrollableProtocol.h'
2) Target 'React' has copy command from '<PATH_TO_PROJECT>/node_modules/react-native/React/Views/ScrollView/RCTScrollableProtocol.h' to '<HOME>/Library/Developer/Xcode/DerivedData/ReactNativeSimple-dpupkkuvhsslwxgngxzqgwsrazap/Build/Intermediates.noindex/ArchiveIntermediates/ReactNativeSimple/BuildProductsPath/Release-iphoneos/include/React/RCTScrollableProtocol.h'
error: Multiple commands produce '<HOME>/Library/Developer/Xcode/DerivedData/ReactNativeSimple-dpupkkuvhsslwxgngxzqgwsrazap/Build/Intermediates.noindex/ArchiveIntermediates/ReactNativeSimple/BuildProductsPath/Release-iphoneos/include/double-conversion/fast-dtoa.h':
1) Target 'double-conversion-tvOS' has copy command from '<PATH_TO_PROJECT>/node_modules/react-native/third-party/double-conversion-1.1.5/src/fast-dtoa.h' to '<HOME>/Library/Developer/Xcode/DerivedData/ReactNativeSimple-dpupkkuvhsslwxgngxzqgwsrazap/Build/Intermediates.noindex/ArchiveIntermediates/ReactNativeSimple/BuildProductsPath/Release-iphoneos/include/double-conversion/fast-dtoa.h'
2) Target 'double-conversion' has copy command from '<PATH_TO_PROJECT>/node_modules/react-native/third-party/double-conversion-1.1.5/src/fast-dtoa.h' to '<HOME>/Library/Developer/Xcode/DerivedData/ReactNativeSimple-dpupkkuvhsslwxgngxzqgwsrazap/Build/Intermediates.noindex/ArchiveIntermediates/ReactNativeSimple/BuildProductsPath/Release-iphoneos/include/double-conversion/fast-dtoa.h'
...

Repro steps:

  • react-native init
  • xcodebuild -project <PATH_TO_PROJECT>/ios/ReactNativeSimple.xcodeproj -scheme ReactNativeSimple archive -sdk iphoneos -archivePath <PATH_TO_PROJECT>/output/build/archive/ReactNativeSimple CODE_SIGN_STYLE=Automatic

Details:

I tested it on the simple RN application that was created by “react-native init” command. When I try to build the app using Xcode 10 GUI - it builds successfully. But I try to build it using xcodebuild command - it failed with the error above.

When we use the same command on the same application (RN 0.56) in Xcode 9.4.1 - it builds successfully If I don’t specify -sdk param in xcodebuild command it builds successfully. Note: Errors may be different for the different Xcode 10 Beta versions.

Questions:

Does RN 0.56 support Xcode 10 Beta? How I can fix it? Is there workaround to build it using Xcode 10 Beta?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:24
  • Comments:69 (11 by maintainers)

github_iconTop GitHub Comments

664reactions
ericschaalcommented, Aug 1, 2018

You can try to change the build system to Legacy, File > Workspace Settings > Build System > Legacy Build System.

502reactions
PaulMestcommented, Sep 19, 2018

I also had the Multiple commands produce error with libReact.a & libyoga.a. I’m using:

  • Xcode 10
  • react-native 0.57.0
  • CocoaPods

To overcome this, I have added this to my Podfile:

  post_install do |installer|
    installer.pods_project.targets.each do |target|

      # The following is needed to ensure the "archive" step works in XCode.
      # It removes React & Yoga from the Pods project, as it is already included in the main project.
      # Without this, you'd see errors when you archive like:
      # "Multiple commands produce ... libReact.a"
      # "Multiple commands produce ... libyoga.a"

      targets_to_ignore = %w(React yoga)
      
      if targets_to_ignore.include? target.name
        target.remove_from_project
      end

    end
  end

Then rebuild your Pods project with:

$ pod install

Full environment details:


  React Native Environment Info:
    System:
      OS: macOS High Sierra 10.13.6
      CPU: x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
      Memory: 4.10 GB / 32.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 10.9.0 - ~/.nvm/versions/node/v10.9.0/bin/node
      Yarn: 1.9.4 - /usr/local/bin/yarn
      npm: 6.4.1 - ~/.nvm/versions/node/v10.9.0/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.0, macOS 10.14, tvOS 12.0, watchOS 5.0
    IDEs:
      Xcode: 10.0/10A255 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.5.0 => 16.5.0
      react-native: 0.57.0 => 0.57.0
    npmGlobalPackages:
      create-react-native-app: 1.0.0
      react-native-cli: 2.0.1
Read more comments on GitHub >

github_iconTop Results From Across the Web

Xcode 12.5 Multiple commands produ… - Apple Developer
Hi, I'm from the App Center SDKs team. After updating Xcode from 12.4 to 12.5 our team faced build issues similar to this:...
Read more >
Xcode 10 Error: Multiple commands produce - Stack Overflow
this error may happen when you choose a name for your project that is the same as one of the dependencies that you...
Read more >
[Xcode 11] 'Multiple commands produce' error when building ...
It looks like a bug or some new issue with new Xcode version. Error response is: Failed to build iOS project. We ran...
Read more >
Xcode Error: Multiple commands produce - Handy Opinion
"Multiple commands produce" is a common Error in Xcode when we build our App. Changing Build system to Legacy Build System is a...
Read more >
xcode 12 New Build System warns multiple commands ...
xcode 12 New Build System warns multiple commands produce Assets. car. In this case, one explanation is that your Copy Resources build phase...
Read more >

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Hashnode Post

No results found