Xcode 10错误:为'app'和'appex'生成多个命令

问题描述 投票:18回答:11

我得到了最近讨论的“Xcode 10错误:多个命令产生...”错误,但是对于我的项目的结果app和appex文件。有谁知道这意味着什么。我的项目有一个应用程序和两个扩展(只有一个是错误的一部分)。

Showing Recent Messages

Prepare build
note: Using new build systemnote: Planning buildnote: Constructing build description

Build system information
error: Multiple commands produce '/Users/xxx/Library/Developer/Xcode/DerivedData/MyApp-enqofdpadskdcgemmhrzsxahnjet/Build/Products/Debug-iphoneos/MyApp Dev.app':
1) Target 'MyApp Dev' has create directory command with output '/Users/xxx/Library/Developer/Xcode/DerivedData/MyApp-enqofdpadskdcgemmhrzsxahnjet/Build/Products/Debug-iphoneos/MyApp Dev.app'
2) That command depends on command in Target 'MyApp Dev': script phase “[CP] Copy Pods Resources”

Build system information
error: Multiple commands produce '/Users/xxx/Library/Developer/Xcode/DerivedData/MyApp-enqofdpadskdcgemmhrzsxahnjet/Build/Products/Debug-iphoneos/MyApp Dev Share Extension.appex':
1) Target 'MyApp Dev Share Extension' has create directory command with output '/Users/xxx/Library/Developer/Xcode/DerivedData/MyApp-enqofdpadskdcgemmhrzsxahnjet/Build/Products/Debug-iphoneos/MyApp Dev Share Extension.appex'
2) That command depends on command in Target 'MyApp Dev Share Extension': script phase “[CP] Copy Pods Resources”

Build system information
warning: ignoring duplicated output file: '/Users/xxx/Library/Developer/Xcode/DerivedData/MyApp-enqofdpadskdcgemmhrzsxahnjet/Build/Products/Debug-iphoneos/MyApp Dev.app' (in target 'MyApp Dev')
Build system information
warning: ignoring duplicated output file: '/Users/xxx/Library/Developer/Xcode/DerivedData/MyApp-enqofdpadskdcgemmhrzsxahnjet/Build/Products/Debug-iphoneos/MyApp Dev Share Extension.appex' (in target 'MyApp Dev Share Extension')

Build failed    18.09.18, 10:28    4.5 seconds

我知道我可以回到遗留构建系统,但我更喜欢使用新的更快的构建系统。感谢您的任何帮助。

ios xcode10
11个回答
26
投票

通过将Cocoapods从1.4.0更新到1.5.3解决了我的问题


0
投票

如果您的错误没有通过更新可可豆荚消失,那么只需创建新项目,但更改文件夹位置。你不会得到这个错误。


0
投票

关键是要做pod deintegraterm *.workspace文件!


0
投票

我有这样的问题。 。 。对我有用的解决方案是转到Project Target并在Copy Bundle Resources下删除文件的重复引用。希望这可以帮助!!!


23
投票

如果有人在更新cocoapods并重新安装pod之后仍在努力解决这个问题:

  1. 打开目标的构建阶段,为您提供问题
  2. 打开Copy Pods Resources阶段。
  3. 确保输出文件为空。在我的情况下,我有一个奇怪的条目${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}。我删除它,构建成功

11
投票

我的Cocoapod版本已经是1.5.3(最新)。只运行“pod install”(或“pod install --no-repo-update”,如果你不想更新现有的pod)解决了它。


11
投票

我能够通过在Xcode 10中打开Runner工作区项目来修复它。然后导航到File,Workspace Settings并将构建系统更改为Legacy Build System。

image shows where it's changed


6
投票

我的解决方法:

  1. 检查您的pod版本pod --version。通过运行sudo gem install cocoapods,将Coacoapods更新到最新版本 - 如果不是,则更新v1.5.3
  2. 通过运行pod update更新所有pod
  3. 如果有的话,从info.plist删除重复的Target>Build Phases>Copy Bundle Resources文件。

5
投票

适合我:

  • 更新Cocoapods
  • 删除pod文件(不要忘记将内容复制到其他地方,这样你就可以恢复它)
  • 删除工作区项目文件
  • 删除锁定pod文件
  • 删除pod目录
  • 关闭Xcode
  • 初始化pod
  • 安装pod
  • 打开工作区项目。

1
投票

你可能遇到过这个由CocoaPods issue引起的Xcode issue

这个reply可能对你有所帮助,它建议在你的Podfile中明确指定子规格。

例如,使用pod 'SDWebImage/Core'而不是pod 'SDWebImage'

显然,这会导致构建产品路径始终包含可能解决问题的子规范名称。


1
投票

在“共享工作区设置”中将“构建系统”设置为“旧版构建系统”,您可以在“文件 - >工作区设置”中找到它


0
投票

就我而言,App Target的Copy Bundle Resources中有重复引用。我刚刚删除了其中一个而且工作正常。

© www.soinside.com 2019 - 2024. All rights reserved.