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

Wrong version in SPM Xcode 15.3, latest release 17.0.0 but SPM package declares 14.1.0 #2363

Open
5 tasks done
Volodymyr-13 opened this issue Mar 20, 2024 · 9 comments
Open
5 tasks done

Comments

@Volodymyr-13
Copy link

Checklist before submitting a bug report

Xcode version

15.3

Facebook iOS SDK version

https://github.com/facebook/facebook-ios-sdk

Dependency Manager

SPM

SDK Framework

Other / I don't know

Goals

Integrate via SPM a https://github.com/facebook/facebook-ios-sdk latest version

Expected results

Uses latest version from Releases

Actual results

It uses old version by default, not the latest from Releases

Steps to reproduce

Just add this repo via SPM
Screenshot 1

Screenshot

Code samples & details

No response

@Volodymyr-13 Volodymyr-13 changed the title Wrong version in SPM Xcode 15.3 Wrong version in SPM Xcode 15.3, latest release 16.3.1 but SPM package declares 14.1.0 Mar 20, 2024
@ayushmahajan12
Copy link

@Volodymyr-13 , you can change the dependency rule and select the "Exact version" from the dropdown and enter the version 16.3.1, then try

@zhangwei5436
Copy link

updating Facebook SDK to 17.0.0 bug it is fail ,please update to 17.0.0

@zhangwei5436
Copy link

I want to updating Facebook SDK to 17.0.0 bug it is fail ,please update to 17.0.0

@zhangwei5436
Copy link

I'm currently using Facebook SDK version 16.3.1 in my Swift project,but ,it don't include Privacy Manifests,please update 17.0.0

@Volodymyr-13 Volodymyr-13 changed the title Wrong version in SPM Xcode 15.3, latest release 16.3.1 but SPM package declares 14.1.0 Wrong version in SPM Xcode 15.3, latest release 17.0.0 but SPM package declares 14.1.0 Mar 28, 2024
@Volodymyr-13
Copy link
Author

Volodymyr-13 commented Mar 28, 2024

Same here for 17.0.0

@ayushmahajan12 this should be updated in package here.. they just don't do this.. only they from all any other SDK's.. well facebook is facebook..

@RGG-jayoung
Copy link

RGG-jayoung commented Apr 2, 2024

This issue is caused by Facebook tagging the releases inconsistently. There are multiple entries for 14.1.0. All other releases are prefixed with a v. Swift package manager is prioritizing the numeric 14.1.0 naming scheme over the alphanumeric v14.1.0.

Here it is in context:

image

If Facebook were to remove the v prefix and use numeric version tags and/or keep everything consistent, then Xcode and SPM would pull in the correct version.

Using multiple schemes like this has caused issues like this in the past with other packages.

Facebook can you help?

@RGG-jayoung
Copy link

RGG-jayoung commented Apr 2, 2024

As an experiment, you can create a new blank Swift Package and manually link the dependencies:

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

import PackageDescription

let package = Package(
    name: "FacebookSPMTest",
    products: [
        // Products define the executables and libraries a package produces, making them visible to other packages.
        .library(
            name: "FacebookSPMTest",
            targets: ["FacebookSPMTest"]),
    ],
    dependencies: [
        .package(url: "https://github.com/facebook/facebook-ios-sdk", exact: .init(stringLiteral: "v16.3.1"))
    ],
    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: "FacebookSPMTest",
            dependencies: [
                .product(name: "FacebookCore", package: "facebook-ios-sdk"),
                .product(name: "FacebookLogin", package: "facebook-ios-sdk")
            ]),
        .testTarget(
            name: "FacebookSPMTestTests",
            dependencies: ["FacebookSPMTest"]),
    ]
)
image image

Specifying a direct commit hash for the release works and the products like FacebookCore and FacebookLogin are available.

let package = Package(
    name: "FacebookSPMTest",
    products: [
        // Products define the executables and libraries a package produces, making them visible to other packages.
        .library(
            name: "FacebookSPMTest",
            targets: ["FacebookSPMTest"]),
    ],
    dependencies: [
        .package(url: "https://github.com/facebook/facebook-ios-sdk", revision: "3fe31c1")
    ],
    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: "FacebookSPMTest",
            dependencies: [
                .product(name: "FacebookCore", package: "facebook-ios-sdk"),
                .product(name: "FacebookLogin", package: "facebook-ios-sdk")
            ]),
        .testTarget(
            name: "FacebookSPMTestTests",
            dependencies: ["FacebookSPMTest"]),
    ]
)
image

Curiously, if you specify the exact version number without the v prefix directly in a Package manifest or in Xcode, things work.

dependencies: [
        .package(url: "https://github.com/facebook/facebook-ios-sdk", exact: .init(stringLiteral: "16.3.1"))
        // Doesn't Work
        // .package(url: "https://github.com/facebook/facebook-ios-sdk", exact: .init(stringLiteral: "v16.3.1"))
    ],

@ayushmahajan12
Copy link

zhangwei5436

Can I know, After updating SDK version i.e. 16.3.1 are you able to see the exact version on facebook developer account.

I updated the SDK version to 16.3.1 but I'm not able to see the that version on Meta developer account, it is displaying the 0.3.1 instead oi 16.3.1

@gun-bro98
Copy link

I also had this problem and tried to install with SPM, but there was no suitable version.
I figured it out after several attempts.

Please change the Facebook version in Package Dependencies of the project.

스크린샷 2024-04-11 오후 1 17 26

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

No branches or pull requests

5 participants