ios-client
ios-client copied to clipboard
Cannot import speechly package
Describe the bug
Unable to import the speechly package
Steps to reproduce
Steps to reproduce the behavior:
- Go to my codebase
- Use
swift package init - Add the package by using the code from https://docs.speechly.com/client-libraries/usage/?platform=iOS
// swift-tools-version:5.3
import PackageDescription
let package = Package(
name: "MySpeechlyApp",
dependencies: [
.package(name: "speechly-ios-client", url: "https://github.com/speechly/ios-client.git", from: "0.3.0"),
],
targets: [
.target(name: "MySpeechlyApp", dependencies: []),
.testTarget(name: "MySpeechlyAppTests", dependencies: ["MySpeechlyApp"]),
]
)
- Run
swift build - Got the error 'the library 'Speechly' requires macos 10.10, but depends on the product 'SnapKit' which requires macos 10.11; consider changing the library 'Speechly' to require macos 10.11 or later, or the product 'SnapKit' to require macos 10.10 or earlier.`
- Tried adding
platforms: [ .macOS(.v10_11) ],into the package, but still got the same error. - Furthermore,
import Speechlygave this errorCould not read serialized diagnostics file: error("Invalid diagnostics signature") (in target 'xxx' from project 'xxx')Command EmitSwiftModule failed with a nonzero exit code
Environment
- Platform: [XCode simulator]
- OS: [iOS]
- Package version [0.3.0]
@snowyaya
Hi! Looks like you are trying to build a Swift application for macOS. However, the speechly-ios-client is only supported on iOS, and has not been tested on macOS.
To make this work, you should tell swift build to use an iOS target, or perhaps use some other build tool such as xcodebuild.
To see a complete example iOS application that uses speechly-ios-client please check out https://github.com/speechly/ios-repo-filtering
After I double checked the project, it doesn't seem the project runs on macOS.