facebook / facebook/facebook-ios-sdk
SwiftUI previews failing with SettingsError: noExecutablePath(<IDESwiftPackageStaticLibraryProductBuildable:ObjectIdentifier:'FacebookBasics'>)
- Dominant language
- Swift
- Stars
- 8.1k
- Forks
- 3.7k
- PR merge metrics
- No merged PRs in 30d
Description
### Checklist before submitting a bug report
- [X] I've updated to the latest released version of the SDK
- [X] I've searched for existing [GitHub issues](https://github.com/facebook/facebook-ios-sdk/issues)
- [X] I've looked for existing answers on [Stack Overflow](https://facebook.stackoverflow.com), the [Facebook Developer Community Forum](https://developers.facebook.com/community/) and the [Facebook Developers Group](https://www.facebook.com/groups/fbdevelopers)
- [X] I've read the [Code of Conduct](https://github.com/facebook/facebook-ios-sdk/blob/main/CODE_OF_CONDUCT.md)
- [X] This issue is not security related and can safely be disclosed publicly on GitHub
### 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:

When tapping into the diagnostics we see:

### Steps to reproduce
- Create a new SwiftUI Xcode project
- Open/continue with Xcode 14 (i.e. not Xcode 13)
- Add the Facebook SDK as a SPM dependency (tick 'Basic' option when prompted)
- Go to to ContentView.swift and use the preview option next to the Swift code (if not already open: Editor > Canvas)
### Code samples & details
```swift
// 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()
}
}
```
Contributor guide
Assessment
This issue has not been assessed yet.