facebook / facebook-ios-sdk

Used to integrate the Facebook Platform with your iOS & tvOS apps.
https://developers.facebook.com/docs/ios
Other
7.75k stars 3.51k forks source link

SwiftUI previews failing with SettingsError: noExecutablePath(<IDESwiftPackageStaticLibraryProductBuildable:ObjectIdentifier:'FacebookBasics'>) #2120

Open kevinpalser opened 1 year ago

kevinpalser commented 1 year ago

Checklist before submitting a bug report

Xcode version

14.0.1

Facebook iOS SDK version

15.0.0

Dependency Manager

SPM

SDK Framework

Core

Goals

We have a modern project written in SwiftUI. We rely heavily on on the Xcode SwitfUI previews functionality. We want to use a Facebook SPM dependency and not loose access to the Previews whilst using the latest versions of Xcode.

Expected results

From any Swift script containing a PreviewProvider instance to see the corresponding view rendered when using the Xcode menu option: Editor > Canvas.

Actual results

It fails to build the previews:

Captura de pantalla 2022-09-30 a les 13 58 37

When tapping into the diagnostics we see:

Captura de pantalla 2022-09-30 a les 13 59 29

Steps to reproduce

Code samples & details

// Standard file when creating SwiftUI project.
// Previews rendered correctly with previously with Xcode 13 and the Facebook SPM.
// We had the same problem with the Facebook iOS SDK 14.1.0 and Xcode 14. We were
// hoping that Facebook iOS SDK 15.0.0 would resolve the problem.

import SwiftUI

struct ContentView: View {
    var body: some View {
        VStack {
            Image(systemName: "globe")
                .imageScale(.large)
                .foregroundColor(.accentColor)
            Text("Hello, world!")
        }
        .padding()
    }
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}
kevinpalser commented 1 year ago

Has been resolved when testing with Xcode 14.1 RC.