gpt4 book ai didi

ios - Xcode 无法生成 Swift UI 预览 - 由于内部错误 : planningFailed,构建中止

转载 作者:行者123 更新时间:2023-12-03 11:15:57 25 4
gpt4 key购买 nike

我使用的是 Xcode 12 beta 2。我已经将我的库打包在 Swift Packages 中。 DataModel出现在错误消息中的就是其中之一,即我当前的包,WeatherView取决于。
我可以很好地构建包,但 Swift UI 预览失败
enter image description here

build aborted due to an internal error: planningFailed("multiple configured targets of \'DataModel\' are being created for iOS Simulator")

----------------------------------------

SchemeBuildError: Failed to build the scheme "WeatherView"

unexpected service error: build aborted due to an internal error: planningFailed("multiple configured targets of \'DataModel\' are being created for iOS Simulator")

Build system information:
error: unexpected service error: build aborted due to an internal error: planningFailed("multiple configured targets of \'DataModel\' are being created for iOS Simulator")

最佳答案

我发现使产品库“动态”(而不是静态)可以使我的预览从包的目标内部工作。

let package = Package(
name: "Modules",
platforms: [
.iOS(.v13)
],
products: [
.library(
name: "Modules",
type: .dynamic,
targets: ["App"]
),
],
dependencies: [],
targets: [
.target(
name: "App",
dependencies: []
),
.testTarget(
name: "AppTests",
dependencies: ["App"]
),
]
)
还必须声明包的平台。

关于ios - Xcode 无法生成 Swift UI 预览 - 由于内部错误 : planningFailed,构建中止,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62826612/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com