Search code examples
swiftcocoapodspodspecswift-snapshot-testing

I get "xcodebuild: Returned an unsuccessful exit code" when I pod spec lint my library


I get "xcodebuild: Returned an unsuccessful exit code" when I pod spec lint my library. I know it has something todo with snapshot testing package version but I don't know how to fix that.

Here is my swift package config:

let package = Package(
    name: "PersianJustify",
    platforms: [.iOS(.v13), .macOS(.v11), .tvOS(.v12)],
    products: [
        // Products define the executables and libraries a package produces, making them visible to other packages.
        .library(
            name: "PersianJustify",
            targets: ["PersianJustify"]),
    ],
    dependencies: [
        .package(url: "https://github.com/ArtSabintsev/FontBlaster", from: "5.3.0"),
        .package(url: "https://github.com/pointfreeco/swift-snapshot-testing", from: "1.15.4"),
    ],
    targets: [
        // Targets are the basic building blocks of a package, defining a module or a test suite.
        // Targets can depend on other targets in this package and products from dependencies.
        .target(
            name: "PersianJustify"),
        .testTarget(
            name: "PersianJustifyTests",
            dependencies: [
                "PersianJustify",
                "FontBlaster",
                .product(name: "SnapshotTesting", package: "swift-snapshot-testing"),
            ],
            exclude: ["SnapshotTests/__Snapshots__"],
            resources: [.process("Resources")]
        ),
    ]
)

Here is my podspec config:

Pod::Spec.new do |s|
  s.name             = 'PersianJustify'
  s.version          = '0.6.1'
  s.summary          = 'Justify Persian / Arabic / Hebrew languages texts from the right!'
  s.description      = 'Not very efficient way to justify Hebrew languages in iOS using the Swift language and CoreText.'
  s.homepage         = 'https://github.com/HappyIosDeveloper/PersianJustify'
  s.license          = { :type => 'MIT', :file => 'LICENSE' }
  s.author           = { 'Ahmadreza' => '[email protected]' }
  s.platform         = :ios, '10.0'
  s.platform         = :macos, '11'
  s.swift_version    = '5.0'
  s.dependency 'FontBlaster'
  s.dependency 'SnapshotTesting'
  s.source_files = "Sources/PersianJustify/*.{h,m,swift}"
  s.source = { :git => 'https://github.com/HappyIosDeveloper/PersianJustify.git', :tag => '0.6.1' }

end

Here is the error:

-> PersianJustify (0.6.1)
- ERROR | [OSX] xcodebuild: Returned an unsuccessful exit code.
- NOTE  | xcodebuild:  note: Using codesigning identity override: 
- NOTE  | [OSX] xcodebuild:  note: Building targets in dependency order
- NOTE  | [OSX] xcodebuild:  note: Target dependency graph (5 targets)
- ERROR | xcodebuild:  SnapshotTesting/Sources/SnapshotTesting/Snapshotting/NSBezierPath.swift:44:8: error: 'curveTo' is only available in macOS 11.0 or newer
- NOTE  | xcodebuild:  SnapshotTesting/Sources/SnapshotTesting/Snapshotting/NSBezierPath.swift:44:8: note: add 'if #available' version check
- NOTE  | xcodebuild:  SnapshotTesting/Sources/SnapshotTesting/Snapshotting/NSBezierPath.swift:40:22: note: add @available attribute to enclosing static method
- NOTE  | xcodebuild:  SnapshotTesting/Sources/SnapshotTesting/Snapshotting/NSBezierPath.swift:29:1: note: add @available attribute to enclosing extension
- ERROR | xcodebuild:  SnapshotTesting/Sources/SnapshotTesting/Snapshotting/NSBezierPath.swift:51:8: error: 'curveTo' is only available in macOS 11.0 or newer
- NOTE  | xcodebuild:  SnapshotTesting/Sources/SnapshotTesting/Snapshotting/NSBezierPath.swift:51:8: note: add 'if #available' version check
- NOTE  | [OSX] xcodebuild:  Pods.xcodeproj: warning: The macOS deployment target 'MACOSX_DEPLOYMENT_TARGET' is set to 10.10, but the range of supported deployment target versions is 10.13 to 14.4.99. (in target 'FontBlaster' from project 'Pods')
- NOTE  | [OSX] xcodebuild:  Pods.xcodeproj: warning: The macOS deployment target 'MACOSX_DEPLOYMENT_TARGET' is set to 10.10, but the range of supported deployment target versions is 10.13 to 14.4.99. (in target 'SnapshotTesting' from project 'Pods')

Solution

  • Replace the s.platform lines with the following:

      s.ios.deployment_target = '10.0'
      s.osx.deployment_target = '11.0'
    

    More details at https://guides.cocoapods.org/syntax/podspec.html#platform