SwiftUI Previews in Xcode 14 failed to run with SettingsError: noExecutablePath(IDESwiftPackageStaticLibraryProductBuildable)

Hello :)

My iOS project does not work with SwiftUI Preview in Xcode 14 beta. The project builds and runs fine, but Preview never works. The error message is as follows.

HumanReadableSwiftError

SettingsError: noExecutablePath(<IDESwiftPackageStaticLibraryProductBuildable:ObjectIdentifier(0x000060002ac3e880):'AppCenterCrashes'>)

I do use the AppCenterCrashes dependency in my project. But I'm not sure if this error message is accurate, because sometimes it reports other packages.

After I executed Generate Report, I found the following error in SerializationErrors.txt.

Error Domain=NSCocoaErrorDomain Code=516 "“LogCaffeineIntent.swift” couldn’t be linked to “Intermediates” because an item with the same name already exists." UserInfo={NSSourceFilePathErrorKey=/Users/gong/Library/Developer/Xcode/DerivedData/.../Build/Intermediates.noindex/HiCoffee.build/Debug-iphonesimulator/IntentsExtension.build/DerivedSources/IntentDefinitionGenerated/Intents/LogCaffeineIntent.swift, NSUserStringVariant=(
    Link
), NSDestinationFilePath=/var/folders/lv/58r5dhv52j779_qn41gnq4c80000gn/T/previews-diagnostics-20220608-144336/Intermediates/LogCaffeineIntent.swift, NSFilePath=/Users/gong/Library/Developer/Xcode/DerivedData/.../Build/Intermediates.noindex/HiCoffee.build/Debug-iphonesimulator/IntentsExtension.build/DerivedSources/IntentDefinitionGenerated/Intents/LogCaffeineIntent.swift, NSUnderlyingError=0x600033223810 {Error Domain=NSPOSIXErrorDomain Code=17 "File exists"}}

The problem seems to be related to the Intent generation code. I don't know how to fix it yet.

Also happening with LNPopupUI Package. I tried using both the regular and static versions and same error.




SettingsError: noExecutablePath(<IDESwiftPackageStaticLibraryProductBuildable:ObjectIdentifier(0x000060007a2bc900):'LNPopupController-Static'>)

Same with Klarna package in Xcode 14.

SettingsError: noExecutablePath(<IDESwiftPackageStaticLibraryProductBuildable:ObjectIdentifier(0x000060001d9b0c90):'KlarnaMobileSDK'>)

And also AWSCore in another project.

SettingsError: noExecutablePath(<IDESwiftPackageStaticLibraryProductBuildable:ObjectIdentifier(0x0000600044578960):'AWSCore'>)

Same error with AppMetrica package:

SettingsError: noExecutablePath(<IDESwiftPackageStaticLibraryProductBuildable:ObjectIdentifier(0x000060001c3052c0):'YandexMobileMetrica'>)

Same with SmartlookAnalytics, see FB11506040

I found a workaround that at least works for Intercom:

  • Create a local package and add the the intercom dependency to that package
  • Remove intercom from the main project
  • Add the local package as a dependency to the main project

Can't say if this works for other packages

I've been finding this with my own SPM packages, and reported by a number of users of that package. Filed bug FB11397938 back in August.

SettingsError: noExecutablePath(<IDESwiftPackageStaticLibraryProductBuildable:ObjectIdentifier(0x000060000d2b3b70):'QRCode'>)

Easily reproducible by adding a package to a blank SwiftUI project in Xcode 14. Cannot be reproduced in Xcode 13.

Also seeing broken previews on X14 release with SPM + AppSpector. Removing the package entirely of course fixes it. No issue on X13.

Still occurs on the Xcode 14 release [Version 14.0 (14A309)]. Booo!

I have the same issue with MSAL package. I've done research and it's happening on beta 5, beta 6 and also the released version of Xcode, it's working well on beta 4 so I'm forced to keep using beta 4 unfortunately for now.

Same problem here:

SettingsError: noExecutablePath(<IDESwiftPackageStaticLibraryProductBuildable:ObjectIdentifier(0x000060002acb5aa0):'CLibreSSL'>)

This time it's even a library that does not get used at all on Apple platforms, since it's conditional in Package.swift:

            dependencies: [

                .product(name: "CLibreSSL", package: "CLibreSSL", condition: .when(platforms: [.linux])),

            ],

Experiencing the same issue with MSAL package, I tried removing it and everything works fine (but of course, it is not a solution). Does anyone have any updates on when it will be fixed?

Please file a bug report at https://feedbackassistant.apple.com/

Until now, there are less than 10 bug reports reported for this issue. Otherwise it will not get fixed soon.

FYI this is fixed for me in Xcode 14.1 beta

Unfortunately, Xcode 14.1 beta (14B5024h) did not fix the issue for me. Still having the same issue.

I can confirm: It's fixed with Xcode 14.1 beta!

SwiftUI Previews in Xcode 14 failed to run with SettingsError: noExecutablePath(IDESwiftPackageStaticLibraryProductBuildable)
 
 
Q