swift - 为 watchos 和今日扩展构建时,Xcode 多个命令会产生错误
问题描述
我正在尝试为我的 iOS 应用程序创建一个 watchOS 和今天的扩展。我已经通过 SPM 将 Realm 和 RealmSwift 添加到手表应用程序中,并且我正在使用 cocoapods 将 AppCenter 添加到 iOS 应用程序中。我很好地运行了 iOS 应用程序,并很好地构建了今天的扩展程序。然后,当我尝试运行 watchos 应用程序时,它给了我这个错误:
Multiple commands produce '/Users/me/Library/Developer/Xcode/DerivedData/App-grfodydruvgwoxaiuyovwnrntjnz/Build/Intermediates.noindex/Previews/App/Products/Debug-iphonesimulator/App.swiftmodule/x86_64-apple-ios-simulator.swiftmodule':
1) Target 'App Today' (project 'App'): Ditto /Users/me/Library/Developer/Xcode/DerivedData/App-grfodydruvgwoxaiuyovwnrntjnz/Build/Intermediates.noindex/Previews/App/Products/Debug-iphonesimulator/App.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/me/Library/Developer/Xcode/DerivedData/App-grfodydruvgwoxaiuyovwnrntjnz/Build/Intermediates.noindex/Previews/App/Intermediates.noindex/App.build/Debug-iphonesimulator/App Today.build/Objects-normal/x86_64/App.swiftmodule
2) Target 'App' (project 'App'): Ditto /Users/me/Library/Developer/Xcode/DerivedData/App-grfodydruvgwoxaiuyovwnrntjnz/Build/Intermediates.noindex/Previews/App/Products/Debug-iphonesimulator/App.swiftmodule/x86_64-apple-ios-simulator.swiftmodule /Users/me/Library/Developer/Xcode/DerivedData/App-grfodydruvgwoxaiuyovwnrntjnz/Build/Intermediates.noindex/Previews/App/Intermediates.noindex/App.build/Debug-iphonesimulator/App.build/Objects-normal/x86_64/App.swiftmodule
我尝试清理构建文件夹、删除派生数据以及重新安装 pod 和包。即使我没有安装任何软件包,它也会发生。只有当我从目标中删除今天的扩展程序和手表应用程序时,它才会再次构建。
我已经完成了我的构建设置,并且在任何目标中都没有重复的文件。
我找不到导致重复文件的原因,似乎它是从我找不到的地方生成的。
解决方案
我已经想通了。我已将今天的扩展名设置为与主 iOS 应用程序相同的名称。显然,这使得编译器制作了两个相同名称的应用程序。我通过更改今天的扩展名来修复它。
推荐阅读
- html - 在 JS 变量中使用 HTML 标签(反应)
- microsoft-teams - 如何在 Microsoft Team App 清单中添加图像轮播?
- php - 在电子商务购物车的 URL 中传递多个 PHP 变量?
- html - 如何在悬停时更改svg颜色
标签无法使用? - sql - 如何跟踪哪些表已/已被修改
- c++ - C++ 在内存安全方面与 Rust 有多接近?
- node.js - 如何将顶级异步等待与打字稿一起使用?
- keycloak - 身份提供者oauth回调失败;无法找到到所请求目标的有效认证路径
- html - 当页脚作为部分包含时,如何从页脚获取页面标题?
- visual-c++ - 未在发布模式下添加 C++/WinRT KeyDown 事件处理程序