For all those struggling with this, I found the fix. Make sure Swift Tools Version is 5.9 at the top of your package.swift file:
// swift-tools-version: 5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.
Then you're allowed to specify iOS 17 in your platforms declaration:
platforms: [.iOS(.v17)],
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: