这是indexloc提供的服务,不要输入任何密码
Skip to content

[Breaking][Xcode 13.0 b3]: "error: 'shared' is unavailable in application extensions for iOS:" #8401

@Panajev

Description

@Panajev

[REQUIRED] Step 1: Describe your environment

  • Xcode version: 13.0 b3
  • Firebase SDK version: 8.3.1
  • Installation method: Swift Package Manager
  • Firebase Component: App Distribution

[REQUIRED] Step 2: Describe the problem

Hello,

When compiling our application, I see an error like:

error: 'shared' is unavailable in application extensions for iOS: Use view controller based solutions where appropriate instead.
            if let windowScene = UIApplication.shared.activeScene {

Note that this was not happening in our app with Xcode 13.0 beta 2, it started happening today when I updated to Xcode 13.0 beta 3). Apple requires the library itself to be annotated like so:

@available(iOSApplicationExtension, unavailable)

See: https://forums.swift.org/t/set-application-extension-api-only-on-a-spm-package/39333/11

This is related to a change in Xcode made by Apple deliberately and for which they provided annotation library authors have to add when declaring methods that would trigger that compilation error.

Thank you in advance for your help :)!

Kind Regards,

Goffredo Marocchi

Notes

  • I reported the bug on Apple's Feedback Reporter tool (it affects lots of libraries and I have no way to let SwiftPM know we do not have any App Extension targets...): FB9337463
  • Reported a thread in the dev forums too: https://developer.apple.com/forums/thread/685103

Steps to reproduce:

What happened? How can we make the problem occur?
Download Xcode 13.0 b3, compile a project that imports Firebase iOS SDK (including App Distribution too) using Swift PM (cocoapods works for this library for now).

Relevant Code:

The compilation issue occurs in Firebase's code as the SwiftPM package is imported.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions