ios-client icon indicating copy to clipboard operation
ios-client copied to clipboard

Cannot import speechly package

Open snowyaya opened this issue 3 years ago • 2 comments

Describe the bug

Unable to import the speechly package

Steps to reproduce

Steps to reproduce the behavior:

  1. Go to my codebase
  2. Use swift package init
  3. 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"]),
    ]
)
  1. Run swift build
  2. 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.`
  3. Tried adding platforms: [ .macOS(.v10_11) ], into the package, but still got the same error.
  4. Furthermore, import Speechly gave this error Could 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 avatar Jul 05 '22 12:07 snowyaya

@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

aukkonen avatar Jul 06 '22 15:07 aukkonen

After I double checked the project, it doesn't seem the project runs on macOS.

snowyaya avatar Jul 11 '22 12:07 snowyaya