Is it possible to depend my package on a 3rd party Objc static lib (header + .a file) included as asset (Swift5.3)

Hi, I am new to creating packages and I am trying to wrap a closed source tracking library into a package to be used by our team to make a simpler interface and to prefix some organisation-specific prefixes to events and such.

The 3rd party lib consists of a number of libs, each has a .a-file and a .h file.

I'd like to provide a Swift interface where I call these libraries under the hood. I am able to make the package build and import and use the package in the main app, however the package does not seem to produce any -o files for the targets with the .a files, and I get

error: Build input files cannot be found: '(...)/Products/Debug-iphonesimulator/ACPIdentity.o', '(...)/Build/Products/Debug-iphonesimulator/ACPAnalytics.o', '(...)/Build/Products/Debug-iphonesimulator/ACPCore.o' (in target 'MyApp' from project 'MyApp')

Is this at all possible to get to work?

My package file:

// swift-tools-version:5.3

import PackageDescription

let package = Package(
    name: "Adobe-Wrapper",
    platforms: [
    products: [
            name: "AdobeWrapper",
            targets: [
    dependencies: [],
    targets: [
            name: "ACPAnalytics",
            dependencies: [],
            path: "./Sources/ACPAnalytics",
            resources: [.process("libACPAnalytics_iOS.a")],
            cSettings: [.headerSearchPath("./Sources/ACPAnalytics")]
            name: "ACPCore",
            dependencies: [],
            path: "./Sources/ACPCore",
            resources: [.process("libACPCore_iOS.a")],
            cSettings: [.headerSearchPath("./Sources/ACPCore")]
            name: "ACPIdentity",
            dependencies: [],
            path: "./Sources/ACPIdentity",
            resources: [.process("libACPIdentity_iOS.a")],
            cSettings: [.headerSearchPath("./Sources/ACPIdentity")]
            name: "AdobeWrapper",
            dependencies: [
                .target(name: "ACPAnalytics"),
                .target(name: "ACPCore"),
                .target(name: "ACPIdentity")
            linkerSettings: [
            name: "AdobeWrapperTests",
            dependencies: ["AdobeWrapper"]),

file structure


I think what you are looking for is

Hi @NeoNacho, thank you! Might be, are you suggesting that I build an xcframework and wrap the library in there with headers and .a-files and subsequently import that xcframework into my package?

Yep that's where I was going, sorry my response should have been more detailed. You can wrap the libraries and headers you have using:

xcodebuild -create-xcframework [-help] [-framework <path>] [-library <path> [-headers <path>]] -output <path>

Note that one XCFramework should contain one library, just in different platform variants, so you may need to create multiple ones.

@NeoNacho Got it, thank you so much for answering!

Terms of Service

Privacy Policy

Cookie Policy