I’ve a framework that’s distributed via cocoaPods and now I need to help SPM
I created a package deal in xCode, as Supply code I solely have a dummy swift file as a result of my framework is an already compiled XCFramework
My Package deal.Swift has the next format
let package deal = Package deal(
title: "MyLibrary",
platforms: [
.iOS(.v12)
],
merchandise: [
// Products define the executables and libraries a package produces, making them visible to other packages.
.library(
name: "MyLibrary",
targets: ["MyLibraryWrapper"]),
],
dependencies: [
.package(name: "Sentry", url: "https://github.com/getsentry/sentry-cocoa", .exact("8.32.0")),
.package(name: "Lottie", url: "https://github.com/airbnb/lottie-spm", .exact("4.3.4")),
... other packages ...
],
targets: [
.binaryTarget(
name: "MyLibrary",
url: "MyLibraryURL",
checksum: "709e8beedce6029b439e7d4bb59e1830060b642b96791586c65a6520ca5ba908"
),
.target(
name: "MyLibraryWrapper",
dependencies: [
.target(name: "MyLibrary"),
.product(name: "Sentry", package: "Sentry"),
.product(name: "Lottie", package: "Lottie"),
... other packages ...
],
path: "Sources",
sources: ["dummy.swift"]
)
],
swiftLanguageVersions: [.v5]
)
once I import this with SPM into the challenge the whole lot seems to be okay and all MyLibrary dependencies are loaded.
however once I run the app I’ve the next error
dyld[4233]: Image not discovered: _OBJC_CLASS_$_SentryClient
Referenced from: /non-public/var/containers/Bundle/Utility/373D3B20-3FF1-4C21-8D83-613FBFE37BB3/Pattern App.app/Frameworks/MyLibrary.framework/MyLibrary
Anticipated in: /non-public/var/containers/Bundle/Utility/373D3B20-3FF1-4C21-8D83-613FBFE37BB3/Pattern App.app/Frameworks/Sentry.framework/Sentry
Message from debugger: killed
Earlier than Sentry I had the identical issues with Lottie however then I simply needed to change the repo
from:
https://github.com/airbnb/lottie-ios.git
to:
https://github.com/airbnb/lottie-spm
I searched and did not discover something about this within the points reported in Sentry’s git.
I additionally tried to import Sentry straight as a targetBinary however with out success.
I attempted to vary the title to sentry-cocoa as reported on this hyperlink but it surely did not work.
Swift package deal product not discovered when added through Package deal.swift dependency
And check out with completely different Sentry variations and at all times have this difficulty