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.

Sadly still seeing this in Xcode 14 RC

I'm also seeing this still in RC of Xcode 14 :( mines is specifically with Stripe terminal SettingsError: noExecutablePath(<IDESwiftPackageStaticLibraryProductBuildable:ObjectIdentifier(0x000060001d168540):'StripeTerminal'>)

Nothing changed with the Xcode 14 RC release.

I created an issue to Apple with a really simple project (new iOS app Swift UI / swift) and add AppCenterCrashes dependency.

FB11474754

I'm not sure it's related to Xcode or the Package.swift compilation / binary distributed.

We have currently the same SwuiftUI preview issue with:

  • AppCenter issue (no binary)
  • GoogleCast without guest mode dynamic xcframework (binaries)

Also broken previews on Xcode14 RC noExecutablePath(<IDESwiftPackageStaticLibraryProductBuildable:ObjectIdentifier(0x000060006b9931b0):'TwilioVideo'>)

I'm also getting the same error with ZendeskSDK using Xcode 14 RC:

HumanReadableSwiftError

SettingsError: noExecutablePath(<IDESwiftPackageStaticLibraryProductBuildable:ObjectIdentifier(0x000060003cf658f0):'ZendeskSDKConfigurationsSDK'>)

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!

Not sure @Dasoga mistyped, but I can confirm that the issue is NOT fixed entirely in 14.1 beta 1.

Reported new issue: FB11515571

Yup, the bug is -- unfortunately -- still present in Xcode 14.1 beta 1.

About AppCenter: See the issue https://github.com/microsoft/appcenter-sdk-apple/issues/2429

We tried with a fork to remove the static type information in the Package.swift. It's fixed. But we didn't try on MacOS platform, only iOS and tvOS.

We have also the same issue with a binary distribution of GoogleCastSDK-ios-no-bluethooth. The SwiftUI previews build consider the binary as a static library, as it's a dynamic one.

Linking against a .dynamic type library fixes the SwiftUI preview breaking (well, at least for me) both on iOS and macOS

For example, linking against QRCodeDynamic (in my package.swift) :- 

.library(
   name: "QRCodeStatic",
   type: .static,
   targets: ["QRCode"]
),
.library(
   name: "QRCodeDynamic", 
   type: .dynamic, 
   targets: ["QRCode"]
)

the SwiftUI previews start working correctly. Linking against a static library type always fails. At least this is a workaround if you're stuck.

This also works if the type is not specified.

.library(
   name: "QRCode",
   targets: ["QRCode"]
),

But not a fix.

Linking against a .dynamic type library may fix the problem, but this is no guarantee. If looking a MSAL, it is defined without a type and thus should work if you trust the statements of some post here. But it does not :(.

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