Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to collect privacy manifest of static xcframework #7317

Open
tamwei opened this issue Feb 4, 2024 · 1 comment
Open

Unable to collect privacy manifest of static xcframework #7317

tamwei opened this issue Feb 4, 2024 · 1 comment
Labels

Comments

@tamwei
Copy link

tamwei commented Feb 4, 2024

Description

The Package.swift of static xcframework is as follows:

import PackageDescription

let package = Package(
    name: "TestSDK",
    products: [
        // Products define the executables and libraries a package produces, and make them visible to other packages.
        .library(
            name: "TestSDK",
            targets: ["TestSDK"]),
    ],
    dependencies: [
        // Dependencies declare other packages that this package depends on.
        // .package(url: /* package url */, from: "1.0.0"),
    ],
    targets: [
        // Targets are the basic building blocks of a package. A target can define a module or a test suite.
        // Targets can depend on other targets in this package, and on products in packages this package depends on.
        .binaryTarget(name: "TestSDK", path: "TestSDK.xcframework")

    ]
)

And the PrivacyInfo.xcprivacy is in TestSDK.xcframework/ios-arm64/TestSDK.framework directory.


Case 1: When integrating static TestSDK.xcframework through SwiftPM in the sample app, the Privacy Report I generated does not contain the privacy manifest of static TestSDK.xcframework.

Case 2: When I change the above static TestSDK.xcframework to a dynamic TestSDK.xcframework, the Privacy Report is correct

Case 3: When I am not using SwiftPM but manually integrating static TestSDK.xcframework, the privacy manifest collected is also correct.

The app.xcarchive of Case2 and Case3 has one more Frameworks folder than the app.xcarchive of Case1, which contains the PrivacyInfo.xcprivacy of TestSDK.xcframework


I want to specify the PrivacyInfo.xcprivacy of static xcframework in the Package.swift file, but binaryTarget does not support that.

Expected behavior

No response

Actual behavior

No response

Steps to reproduce

No response

Swift Package Manager version/commit hash

No response

Swift & OS version (output of swift --version ; uname -a)

No response

@iharkatkavets
Copy link

Few days ago Apple updated their documentation to cover static libs behaviour.

Distribute your static library with a privacy manifest
A static library is an archive of object files with the .a file extension. It doesn’t support resources such as the privacy manifest. If you currently distribute a static library as an SDK and want to update it to include a privacy manifest in Xcode, create a new static framework target that includes all your static library’s source files and resources, then add the privacy manifest to the target’s resource.
If you don’t use Xcode to build your static library, create a static framework bundle for your static library manually, then add the privacy manifest to the bundle as a resource. For more information about framework bundle structure, see Placing content in a bundle. To identify the privacy manifest location in the static framework, see Add a privacy manifest to your framework.

The link here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants