[Question] Cannot create xcframework with the error "project does not contain a scheme"
dazy1030 opened this issue · comments
Naoki Odajima commented
こんにちは。よろしければ日本語でやりとりをしたいです。
やりたいこと
- swift-composable-architectureのライブラリをiOS向けにxcframework化したい
やったこと
- Package.swiftからiOS以外のプラットフォームを削除
- 以下のコマンドを実行
scipio prepare --support-simulators
起こっていること
- 以下のエラーでビルドを進めることができない
🔁 Resolving Dependencies... 🗑️ Cleaning swift-composable-architecture... 📦 Building IdentifiedCollections for iOS 🚀 Combining into XCFramework... 📦 Building OrderedCollections for iOS 🚀 Combining into XCFramework... 📦 Building DequeModule for iOS xcodebuild: error: The project named "swift-composable-architecture" does not contain a scheme named "DequeModule". The "-list" option can be used to find the names of the schemes in the project.
DequeModule
はapple/swift-collectionsのプロダクトの一つ- Package.swiftを追ってみた感じでは依存していないはず?
環境
- MacBook Pro Apple M1 Max 64GB
- macOS Monterey
- Xcode13.4.1 or Xcode14.0.1 のCLT(両方試しました)
解決方法や間違っている部分があればアドバイスいただきたいです。よろしくお願いします。
Kohki Miki commented
フィードバックありがとうございます。試してみたところ確かに再現しました。
Scipioは .build
以下にxcodeprojを生成して、そこからXCFrameworkをビルドするのですが、TCAを依存に加え、prepare
すると、なぜか DequeModule
のファイルがソースツリーに追加されていませんでした。
このXcodeプロジェクトの生成は、SwiftPMの提供する内部の実装を呼んでいるのですが、次期バージョンから削除されるようですし、現在置き換えを検討しています。 #3
まだβ版と言うことでご容赦ください。
これが正しく動いていないのは追加の調査が必要そうですが、swift-collectionsを明示的に依存関係に含めることで、うまく生成できるようです。
// swift-tools-version: 5.7
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "BuildingTCA",
platforms: [
.iOS(.v13),
],
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "BuildingTCA",
targets: ["BuildingTCA"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
.package(url: "https://github.com/pointfreeco/swift-composable-architecture.git", .upToNextMinor(from: "0.42.0")),
.package(url: "https://github.com/apple/swift-collections.git", .upToNextMinor(from: "1.0.0")),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.target(
name: "BuildingTCA",
dependencies: [
.product(
name: "ComposableArchitecture",
package: "swift-composable-architecture"
),
.product(
name: "DequeModule",
package: "swift-collections"
),
.product(
name: "Collections",
package: "swift-collections"
)
]),
]
)
Naoki Odajima commented
調査いただきありがとうございました。
手元の環境でもDequeModuleを依存関係に加えたところ解決しました!
(TCAをクローンしてそのままscipioしていたため、Packageをいじる発想に至れていませんでした…)
こちらこそベータ版にも関わらず勝手に使って質問してお手数おかけしました🙇