-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
'Multiple commands produce' error when building with new Xcode build system #20492
Comments
You can try to change the build system to Legacy, |
We want to use new build system. |
The new build system should be supported. We're tracking any issues people run into with Xcode 10 or the new build system in this task: #19573 At a glance, it does not seem like your issue is covered by what we've fixed so far on master. I'll add it to the list. |
I also had the
To overcome this, I have added this to my 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:
Full environment details:
|
Confirmed @PaulMest's workaround works. Manually deleting Yoga in Xcode, from the |
If you are using |
@PaulMest Thanks, I've made my day |
Hopefully my situation can help you guys fix the issue! Here is the full output:
Essentially, |
@ntomallen I've ran into the exact same issue with duplicate fonts from So far, my app has been running fine & I can compile using XCode 10's new build system. Disclaimer: I am not an experienced iOS developer and hacked these solutions together. I do not know if I have messed something up I don't know about. |
That's exactly what worked for me as well! Though I'm still curious why it is suddenly an error now but not previously.
…On Sep 26, 2018, 2:49 PM -0400, Niels Bokmans ***@***.***>, wrote:
@ntomallen I've ran into the exact same issue with duplicate fonts from react-native-vector-icons and native-base and what I ended up doing was removing the duplicate from my target app's Copy Resources To Bundle section. After this, my project worked again (well, it moved to two different errors, which are described here: libfishhook.a can not be found - fix and Multiple commands produce error with libReact.a & libyoga.a. - fix
So far, my app has been running fine & I can compile using XCode 10's new build system.
Disclaimer: I am not an experienced iOS developer and hacked these solutions together. I do not know if I have messed something up I don't know about.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@ntomallen Basically it's because there is a new, "stricter" build system, and XCode 10 uses it by default whereas in XCode 9 you had to actively choose to use it rather than the "legacy" build system which we've all been using until now. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@PaulMest my hero! Thank you! |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
You have to be more specific. Xcode 10 builds and archives fine for me (after solving some errors I don't remember now), on MacOS 10.12.6 and RN 0.57.0. |
My Podfile post_install looked like this:
Following the suggestion from @PaulMest worked for me. |
@njbmartin Thanks! |
To prevent ios deployment issue: facebook/react-native#20492 (comment) Issue happened when adding yoga pod (used for react-native-svg install)
I am having this issue and I am not using cocoapods. Can't use cocoapods as I am using react-native-navigation. |
@MakhouT using react-native-navigation doesn't restrict you from using cocoapods |
@AngefloMusic React-native-navigation isn't using it and for the setup you need to change some native iOS files. When using cocoapods, I am assuming this will be conflicting with each other when installing pod dependencies. However I am not sure as I haven't cocoapoads too much. So please do correct me if I am wrong. |
@MakhouT They do not conflict. In fact, if you have a look at the |
Sorry I need to reopen this, but the most preferred solution (see Podfile below) brings me to this painful error when trying to produce the archive. this is my podfile
I have React imported both in Link Binary with libraries and in Linked Frameworks and libraries. |
I know this is a solved problem for people who moved RN to Pods or people who use RN > 0.60.x but if you aren't ready yet or migrating this is our temporary solution (It basically removed tvOS config from React Native pbxproj file, which seems to be causing the multiple targets). We use it in our postinstall script const xcode = require('xcode');
const fs = require('fs');
const path = require('path');
const reactNativeProjectPath = path.resolve(__dirname, '../node_modules/react-native/React/React.xcodeproj/project.pbxproj');
const myProj = xcode.project(reactNativeProjectPath);
myProj.parse(err => {
if (err) {
throw err;
}
const nativeTargets = myProj.hash.project.objects.PBXNativeTarget;
Object.keys(nativeTargets).forEach(nativeTargetKey => {
const target = nativeTargets[nativeTargetKey];
if (target.name && target.name.indexOf('-tvOS') !== -1) {
console.log(`Removing ${target.name}:${nativeTargetKey} in React pbxproj`);
delete nativeTargets[nativeTargetKey];
}
});
fs.writeFileSync(reactNativeProjectPath, myProj.writeSync());
console.log(`All mentioned of tvOS removed in React pbxproj`);
}); |
For those who use Fastlane and face this issue, @PaulMest solution works: add all required targets to targets_to_ignore and then run |
Adding to @aerda's answer, I removed all of the fonts (.tff files) used by react-native-vector-icons from Build Phases > Copy Bundle Resources and my project is now building. I believe this error in my case was related to updating to XCode 11, but am not positive about that last part. |
I confirm the same with fonts being duplicate, only after upgrade to Xcode 11 stable today (Mac 10.14.6). Removing fonts under the Was and is using New build system. On RN 0.60.5. |
@fungilation the same with me (Xcode 11 - upgraded today, new build system and RN 0.60.5). I have to removed all font under |
But when I execute |
same here with 0.61.0-rc.3 and xcode 11 11A420a mojave 10.14.6 |
I have only removed react-native-vector-icons tff and it works. No need to delete all tffs |
delete previous pods install pod then run update pod it will work. |
this is what I added to my podfile:
|
I tried this command (with fastlane) but even then the errors persist. 😢
I get similar errors for 4 other libraries that I have installed - Here's my environment -
Been trying to find a solution since morning, have found nothing working so far. 👎 |
For newbies like me: you need to edit the file Then comment out the font lines (files ending in .ttf) like this:
And I had to redo this process every time I ran |
To prevent ios deployment issue: facebook/react-native#20492 (comment) Issue happened when adding yoga pod (used for react-native-svg install)
Hello,
Environment:
Error:
I got the following error when I try to build the simple RN 0.56 application:
Repro steps:
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?
The text was updated successfully, but these errors were encountered: