Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[V2] Build error in Xcode 10 "Multiple commands produce..." #3608

Closed
tiwac100 opened this issue Jul 23, 2018 · 23 comments
Closed

[V2] Build error in Xcode 10 "Multiple commands produce..." #3608

tiwac100 opened this issue Jul 23, 2018 · 23 comments

Comments

@tiwac100
Copy link

Issue Description

After following the installation instructions multiple times and clearing caches in between I still get build errors in Xcode 10:

Steps to Reproduce / Code Snippets / Screenshots

image


Environment

  • React Native Navigation version: 2.0.2425
  • React Native version: 0.56.0
  • Platform(s) (iOS, Android, or both?): iOS
  • Device info (Simulator/Device? OS version? Debug/Release?): Simulator
  • No other dependencies except react-native-navigation installed
@birkir
Copy link
Contributor

birkir commented Jul 24, 2018

I did two things, not sure which one worked:

Check "Copy only when installing"

image

Go to Product > Scheme > Edit Scheme and modified it to look like this, move ReactNativeNavigation above React.

image

@birkir
Copy link
Contributor

birkir commented Jul 24, 2018

I have further issues with clean project, like facebook/react-native#14382 etc.

Maybe time to upgrade to RN 0.56.0 and try to get that stable?

@ghost
Copy link

ghost commented Jul 27, 2018

copy only when installing did the trick for me. Thanks! 👍

@stale
Copy link

stale bot commented Sep 10, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest version and report back. Thank you for your contributions.

@stale stale bot added the 🏚 stale label Sep 10, 2018
@stale
Copy link

stale bot commented Sep 17, 2018

The issue has been closed for inactivity.

@efstathiosntonas
Copy link

efstathiosntonas commented Sep 18, 2018

Possible temp Fix: facebook/react-native#20492 (comment)

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

@benhartouz
Copy link

Check "Copy only when installing"
and remove duplicate files that work for me

@abury
Copy link

abury commented Oct 23, 2018

"Copy only when installing" works, however if you have a CI pipeline, or ever remove node modules folder and reinstall you'll need to do this step again (and again, and again).

We ended up adding a postinstall script to our package.json that updates
./node_modules/react-native-navigation/lib/ios/ReactNativeNavigation.xcodeproj/project.pbxproj

Ticking 'Copy only when installing' changes the following lines in this file:

Line 315
From: buildActionMask = 8;
To: buildActionMask = 12;

Line 322
From: runOnlyForDeploymentPostprocessing = 0;
To: runOnlyForDeploymentPostprocessing = 1;

We're just keeping a copy of the 'ticked' version of this project file in a scripts folder and are copying it across afterwards. Works like a charm

xcode_10_setup.sh

if [ ! -d "node_modules/react-native/third-party" ]; then
  cd node_modules/react-native ; ./scripts/ios-install-third-party.sh ; cd ../../
fi

RNN_PROJECT_PATH='./node_modules/react-native-navigation/lib/ios/ReactNativeNavigation.xcodeproj/project.pbxproj'
cp -f ./scripts/rnn_project.pbxproj $RNN_PROJECT_PATH

@SudoPlz
Copy link
Collaborator

SudoPlz commented Nov 7, 2018

I made a git patch file:

filename react-native-navigation+2.1.2.patch:

diff --git a/node_modules/react-native-navigation/lib/ios/ReactNativeNavigation.xcodeproj/project.pbxproj b/node_modules/react-native-navigation/lib/ios/ReactNativeNavigation.xcodeproj/project.pbxproj
index bb4c3ec..faaaf51 100644
--- a/node_modules/react-native-navigation/lib/ios/ReactNativeNavigation.xcodeproj/project.pbxproj
+++ b/node_modules/react-native-navigation/lib/ios/ReactNativeNavigation.xcodeproj/project.pbxproj
@@ -310,14 +310,14 @@
 /* Begin PBXCopyFilesBuildPhase section */
 		D8AFADBB1BEE6F3F00A4592D /* CopyFiles */ = {
 			isa = PBXCopyFilesBuildPhase;
-			buildActionMask = 2147483647;
+			buildActionMask = 8;
 			dstPath = "include/$(PRODUCT_NAME)";
 			dstSubfolderSpec = 16;
 			files = (
 				50C5FD8320D7D6DD00F1EA8A /* RNNBridgeManagerDelegate.h in CopyFiles */,
 				50C5FD8220D7D6D600F1EA8A /* ReactNativeNavigation.h in CopyFiles */,
 			);
-			runOnlyForDeploymentPostprocessing = 0;
+			runOnlyForDeploymentPostprocessing = 1;
 		};
 /* End PBXCopyFilesBuildPhase section */
 

Then on post install I do:
git apply --ignore-whitespace react-native-navigation+2.1.2.patch

Until that's fixed, this works fine for me.

@sopedro
Copy link

sopedro commented Nov 9, 2018

This is some how buggy but the solution by birkir works for me on ios. Thanks.
In android, some issues too with graddle versions but all solved.

@smartdev619
Copy link

I didn't found Check "Copy only when installing" option in xcode 10.1

@fantasywind
Copy link

I didn't found Check "Copy only when installing" option in xcode 10.1

You have to click ReactNativeNavigation.xcodeproj > Targets (ReactNativeNavigation) > Build Phases > Copy Files

@smartdev619
Copy link

smartdev619 commented Nov 22, 2018 via email

@glocore
Copy link

glocore commented Nov 22, 2018

@smartdev619 I'm using Xcode 10.1 and I was able to find it. Follow exactly the steps mentioned by @fantasywind.
ReactNativeNavigation.xcodeproj is available under "Libraries" in your project navigator.

@glocore
Copy link

glocore commented Nov 22, 2018

After the "copy only when installing" solution, I was facing the following error: 'React/RCTConvert.h' file not found, for which this SO answer worked for me: https://stackoverflow.com/a/41488258/7414945

@nekdev
Copy link

nekdev commented Jan 3, 2019

@platonish @fantasywind I neither can see Targets when selecting Libraries > ReactNativeNavigation.xcodeproj like @smartdev619.

Here is the screenshot:

xcode-rnn-missing-targers

EDIT
Maybe it's because of an old V2 version I'm using (2.0.2478)?

@juansimon18
Copy link

@nekdev i'm using RNN version 2.1.3-patch.2

Copy only when installing

Worked for me

@eduardopelitti
Copy link
Contributor

eduardopelitti commented Aug 20, 2019

Using RN 0.60.4 and RNN v3 Alpha 8, I got the same issue when building through CI.

On local XCode it was working fine and also when building with react-native run-ios, the issue was only happening when using Fastlane + Bitrise.

Logs here:

[15:58:07]: ▸ ❌  error: Multiple commands produce '/Users/vagrant/Library/Developer/Xcode/DerivedData/*****-dubjtuglydxuiregjbywrzzxpkqt/Build/Intermediates.noindex/ArchiveIntermediates/*****/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/libReactNativeNavigation.a':
[15:58:07]: ▸ duplicate output file '/Users/vagrant/Library/Developer/Xcode/DerivedData/*****-dubjtuglydxuiregjbywrzzxpkqt/Build/Intermediates.noindex/ArchiveIntermediates/*****/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/libReactNativeNavigation.a' on task: CreateUniversalBinary /Users/vagrant/Library/Developer/Xcode/DerivedData/*****-dubjtuglydxuiregjbywrzzxpkqt/Build/Intermediates.noindex/ArchiveIntermediates/*****/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/libReactNativeNavigation.a normal armv7 arm64 (in target 'ReactNativeNavigation')
[15:58:07]: ▸ duplicate output file '' on task: CreateUniversalBinary /Users/vagrant/Library/Developer/Xcode/DerivedData/*****-dubjtuglydxuiregjbywrzzxpkqt/Build/Intermediates.noindex/ArchiveIntermediates/*****/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/libReactNativeNavigation.a normal armv7 arm64 (in target 'ReactNativeNavigation')
[15:58:07]: ▸ duplicate output file '' on task: SetMode u+w,go-w,a+rX /Users/vagrant/Library/Developer/Xcode/DerivedData/*****-dubjtuglydxuiregjbywrzzxpkqt/Build/Intermediates.noindex/ArchiveIntermediates/*****/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/libReactNativeNavigation.a (in target 'ReactNativeNavigation')
[15:58:07]: ▸ duplicate output file '' on task: SetOwnerAndGroup vagrant:staff /Users/vagrant/Library/Developer/Xcode/DerivedData/*****-dubjtuglydxuiregjbywrzzxpkqt/Build/Intermediates.noindex/ArchiveIntermediates/*****/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/libReactNativeNavigation.a (in target 'ReactNativeNavigation')
[15:58:07]: ▸ duplicate output file '' on task: SetOwnerAndGroup vagrant:staff /Users/vagrant/Library/Developer/Xcode/DerivedData/*****-dubjtuglydxuiregjbywrzzxpkqt/Build/Intermediates.noindex/ArchiveIntermediates/*****/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/libReactNativeNavigation.a (in target 'ReactNativeNavigation')

Lib wasn't installed via CocoaPods, it was manually linked. I fixed it by not linking it manually or via CocoaPods, it should be auto-linked now. I removed all the references I originally had added when linking the project.

I feel like maybe we could have a more detailed set of instructions for the latest version of RN, due to the changes with how libraries are linked. I could collaborate by going over the steps on a new project.

Note: I didn't try it, but I assume that using Legacy Build System from XCode (in Bitrise's stack) would have masked the issue, but since this is a new project we don't encourage using anything that has been declared as legacy.

@yaronlevi
Copy link

@eduardopelitti Any luck solving this? Happens to us also in Bitrise.

@eduardopelitti
Copy link
Contributor

@eduardopelitti Any luck solving this? Happens to us also in Bitrise.

Hi, I fixed it by removing the manual link of the library and removing it from CocoaPods as well. I removed all references to RNN in my iOS Setup, except the reference in the Header Search path.

And in my Podfile I have:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    if target.name == "yoga"
      target.remove_from_project
    end

    if target.name == "React"
      target.remove_from_project
    end
  end
end

In Bitrise you could try to use the Legacy Build System from the stack (Xcode 9.4) if it still available. This is of course not ideal.

Let me know if it helped.

@adjoaEdwin
Copy link

Hi I fixed it by doing this
Screenshot 2019-10-16 at 11 41 27 PM

Check 'Run script only when installing'

This also fixed my issue with

  • Unrecognized Ionicons after installing react-native-vector-icons

@krishan-kumar-mourya
Copy link

Hi I fixed it by doing this
Screenshot 2019-10-16 at 11 41 27 PM

Check 'Run script only when installing'

This also fixed my issue with

  • Unrecognized Ionicons after installing react-native-vector-icons

this worked for me, Thanks a lot @adjoaEdwin

vshkl pushed a commit to vshkl/react-native-navigation that referenced this issue Feb 5, 2020
@Chrismadscientist
Copy link

fixed my issue doing this

set "Build System" to "Legacy Build System" in "Shared Workspace Settings" which you can find in "File --> Workspace Settings"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests