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

Xcode 13 beta 3 - SwiftPackageManager error App Extensions #1799

Closed
5 tasks done
cmuphobk opened this issue Jul 15, 2021 · 13 comments
Closed
5 tasks done

Xcode 13 beta 3 - SwiftPackageManager error App Extensions #1799

cmuphobk opened this issue Jul 15, 2021 · 13 comments

Comments

@cmuphobk
Copy link

Checklist before submitting a bug report

Xcode version

Xcode 13.0 beta 3 (13A5192i

Swift version

No response

Installation platform & version

SPM 5.4.0

Package

Core

Goals

Probably due to:

Swift Packages
Resolved in Xcode 13 Beta 3
Linking Swift packages from application extension targets or watchOS applications no longer emits unresolvable warnings about linking to libraries not safe for use in application extensions. This means that code referencing APIs annotated as unavailable for use in app extensions must now themselves be annotated as unavailable for use in application extensions, in order to allow that code to be used in both apps and app extensions. (66928265)

Expected results

successful project build

Actual results

Extensions targets don't compile due:

'sharedApplication' is unavailable: not available on iOS (App Extension) - Use view controller based solutions where appropriate instead.
and

'openURL:' is unavailable: not available on iOS (App Extension)

Steps to reproduce

No response

Code samples & details

No response

@lawgimenez
Copy link

Same experience on my end. I can't build my app.

@martinknabbe
Copy link

I get the same compiler error in FBSDKLoginKit as well for FBSDKTooltipView.m line 518

@Zigzag968
Copy link

same for me, can't build

@scannillo
Copy link

One solution is to add NS_EXTENSION_UNAVAILABLE annotations to the methods that aren't available to App Extensions. However, I feel like an ideal solution would be to instead be able to mark the entire Swift Package as not available to app extensions. Does anyone know if this is doable?

facebook-github-bot pushed a commit that referenced this issue Jul 29, 2021
Summary:
While this is not a proper fix, it allows you to compile Facebook SDK with Xcode 13b3 and up.

Kind of a fix for #1799

Pull Request resolved: #1811

Reviewed By: jawwad

Differential Revision: D29961451

Pulled By: joesus

fbshipit-source-id: 8c659809785292bd3fcc4c9e2592b76bf06bc120
@ghost
Copy link

ghost commented Jul 30, 2021

When is this fix being made available?

@deep-randhawa
Copy link

Same issue, cannot build the app.

@deep-randhawa
Copy link

In the meantime, did anyone figure out a workaround?

@pepejeria
Copy link

Same with Xcode 13 beta 4 and Facebook SDK v11.1.0

@jawwad
Copy link
Contributor

jawwad commented Aug 3, 2021

A fix for this has been committed to master with 0e1d877 and will be available with the next release. In the meantime you should be able to point your Podfile or Package.swift file to use the version on master.

You should be able to use one of the following for your Podfile

pod 'FBSDKCoreKit', :git => 'https://github.com/facebook/facebook-ios-sdk.git', :branch => 'master'
- or -
pod 'FBSDKCoreKit', :git => 'https://github.com/facebook/facebook-ios-sdk.git', :commit => '0e1d8774db'

And something like the following for your Package.swift file

.package(
    url: "https://github.com/facebook/facebook-ios-sdk.git",
    .branch("master")
)

.package(
    url: "https://github.com/facebook/facebook-ios-sdk.git",
    .revision("0e1d8774db783d85bd8fc3b53ec96444c048ae42")
)

Syntax Reference:
https://guides.cocoapods.org/using/the-podfile.html#from-a-podspec-in-the-root-of-a-library-repo
https://www.swiftbysundell.com/articles/managing-dependencies-using-the-swift-package-manager/

@S2Ler
Copy link
Contributor

S2Ler commented Aug 10, 2021

Xcode13b5 reverts this breaking change. Things should go back to normal from now on.

@pepejeria
Copy link

I can confirm that this works now in Xcode 13 beta 5.

@dotswift
Copy link

I can confirm that this works now in Xcode 13 beta 5.

Agreed! Looks good on my end in XCode 13 beta 5.

@jawwad
Copy link
Contributor

jawwad commented Aug 23, 2021

Closing this out as it fixed in the latest Xcode beta.

@jawwad jawwad closed this as completed Aug 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants