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
xcode 10 error: multiple commands produce - react 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 升级到最新版本来修复它:
- Close Xcode project.
- Upgrade cocoapods to latest version - run "sudo gem install cocoapods"
- Follow steps hereto remove existing pods
- Run "pod install" in the project directory
- 关闭 Xcode 项目。
- 将 cocoapods 升级到最新版本 - 运行“sudo gem install cocoapods”
- 按照此处的步骤删除现有 Pod
- 在项目目录中运行“pod install”
回答by Raj Joshi
回答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: