xcode 10 错误:产生多个命令 - 反应原生

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/52452472/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 10:48:04  来源:igfitidea点击:

xcode 10 error: multiple commands produce - react native

iosxcodereact-native

提问by Michael Hsu

So there are a lot of questions like this already, but I'm having the same error, notrelating to cocoapods or info.plist, at least I don't think, because none of the solutions worked for me.

因此,有很多这样的问题了,但我有同样的错误,涉及的CocoaPods或info.plist中,至少我不认为,因为没有解决方案对我来说有效。

I just recently upgraded to Xcode 10.0, and building my react native app gives this error:

我最近刚刚升级到 Xcode 10.0,在构建我的 React Native 应用程序时出现以下错误:

Multiple commands produce '/Users/username/Library/Developer/Xcode/DerivedData/appname-code/Build/Products/Release-iphoneos/appname.app':
1) Target 'appname' has create directory command with output '/Users/username/Library/Developer/Xcode/DerivedData/appname-code/Build/Products/Release-iphoneos/appname.app'
2) That command depends on command in Target 'appname': script phase “[CP] Copy Pods Resources”

How do I fix this error?

我该如何解决这个错误?

采纳答案by Michael Hsu

I fixed it by upgrading cocoapods to the latest version:

我通过将 cocoapods 升级到最新版本来修复它:

  1. Close Xcode project.
  2. Upgrade cocoapods to latest version - run "sudo gem install cocoapods"
  3. Follow steps hereto remove existing pods
  4. Run "pod install" in the project directory
  1. 关闭 Xcode 项目。
  2. 将 cocoapods 升级到最新版本 - 运行“sudo gem install cocoapods”
  3. 按照此处的步骤删除现有 Pod
  4. 在项目目录中运行“pod install”

回答by Raj Joshi

I have resolved my issue in Xcode 10.2 through below steps:

我已经通过以下步骤在 Xcode 10.2 中解决了我的问题:

change the build system to Legacy

将构建系统更改为 Legacy

File > Workspace Settings > Build System > Legacy Build System.

文件 > 工作区设置 > 构建系统 > 传统构建系统。

enter image description here

在此处输入图片说明

回答by Santiago Martí Olbrich

For those using React Native and Cocoapods

对于那些使用 React Native 和 Cocoapods 的人

The issue was produced by some libRN...afiles. I fixed it by removing some of them like libRNScreens.a and libRNGestureHandler.a from Build Phases -> Link Binary with Librariessince they were already being referenced from another libraries. Others had to be replaced by their Pod version like libRNDeviceInfo.a:

这个问题是由一些libRN...a文件产生的。我通过从Build Phases -> Link Binary with Libraries 中删除其中一些像 libRNScreens.a 和 libRNGestureHandler.a 来修复它,因为它们已经被其他库引用了。其他人必须被他们的 Pod 版本替换,比如 libRNDeviceInfo.a:

enter image description hereenter image description here

在此处输入图片说明在此处输入图片说明