airbnb / lottie-ios

An iOS library to natively render After Effects vector animations
http://airbnb.io/lottie/
Apache License 2.0
25.67k stars 3.74k forks source link

SPM fails to compile when lottie-spm is added via SPM Package.swift file #2321

Closed JustasL closed 7 months ago

JustasL commented 7 months ago

Hello, I am not sure why but lottie-spm fails to compile when used in Package.swift file

Here's my Package.swift file:

// swift-tools-version: 5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
    name: "DemoSPM",
    products: [
        .library(
            name: "DemoSPM",
            targets: ["DemoSPM"]),
    ],
    dependencies: [
        .package(url: "https://github.com/airbnb/lottie-spm.git", from: "4.4.0"),
    ],
    targets: [
        .target(
            name: "DemoSPM", dependencies: ["Lottie"]
        ),
    ]
)

And I get error: product 'Lottie' required by package 'demospm' target 'DemoSPM' not found.

However if instead of dependency I use binary everything works fine:

.binaryTarget(
    name: "Lottie",
    url: "https://github.com/airbnb/lottie-ios/releases/download/4.4.0/Lottie-Xcode-15.2.xcframework.zip",
    checksum: "2554036cb98d10d9d3e4c61fe17ba629f528e308323ff2d22b187f3a9557671e"
)

Which Version of Lottie are you using?

Lottie 4.4.0

JustasL commented 7 months ago

Never mind, the issue was cause due to swift-tools-version: 5.9, as Lottie only support 5.7