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.

Post not yet marked as solved Up vote post of Gong Down vote post of Gong
23k views
  • Hola. eres desarrollador ios en Mexico ?

Add a Comment

Replies

Still seeing this on Xcode 14.0.1


SettingsError: noExecutablePath(<IDESwiftPackageStaticLibraryProductBuildable:ObjectIdentifier(0x000060002d71f930):'PhraseSDK'>)

I'm using AppCenter and MSAL with SPM, and I managed to solve the issue.

First I tried the local package idea suggested above but that didn't solve anything.

AppCenter is rolling a fix (which at the moment of writing this isn't merged yet): https://github.com/microsoft/appcenter-sdk-apple/pull/2433 Their fix is to remove the hardcoded library type from their Package.swift.

For MSAL, they don't have this hardcoded setting, so I'm not sure what exactly causes the issue. But gladly on Xcode 14.1 beta 3 (14B5033e), using MSAL via SPM won't cause the error anymore.

So a solution for me was to pin AppCenter to that branch + use Xcode 14.1 beta.

  • Can confirm this works for me. Apple needs to fix this in Xcode ASAP, package maintainers can't be expected to work around Xcode's bugs with hacky workarounds like changing the library type.

  • ^^^ Thanks hybridcattt2 - That worked for me. Xcode 14.1 RC2

Add a Comment

sigh Still an issue in the Xcode 14.1 release. Exhausting.

I found that if any of the SPM packages using binary dependencies the preview will fail.

if my case it was a local Package with Firebase Binaries

    targets: [
		.binaryTarget(name: "FirebaseAnalytics", path: "Frameworks/FirebaseAnalytics/FirebaseAnalytics.xcframework"),

After I removed the local package with binaries I can finally see my preview.

Xcode 14.1 fixed that issue for me (After 2 month) 🙏🏽

Still seeing this issue with Xcode 14.1 and the library "ProgressHUD".

SettingsError: noExecutablePath(<IDESwiftPackageStaticLibraryProductBuildable:ObjectIdentifier(0x000060000bec3ba0):'ProgressHUD'>)

An issue has been logged with the offending package, but this used to work without changes needed in the package.

Maybe removing type: .static is all that is needed there too? (Like was done here.)

I followed Microsoft's approach with my own libraries and removed the library type(s) from the Package.swift file and the issue 'goes away'. Hopefully this reduces the bug reports coming in stating that my library has 'broken' SwiftUI.

However, this is purely a workaround of the issue and not a solution. Some clients want to explicitly define their library usage and for them the Xcode bug persists.

If this is somehow my problem (ie. I'm using SPM incorrectly) then it would be awesome to understand how to fix it (especially since Xcode 13 didn't have this issue).

Xcode 14.2 seems to have fixed this for my case w/ conditional SPM dependencies for !APPLE platforms. Closing FB11511342 then.

Xcode 14.2 appears to have resolved this issue for my apps - I'm being slightly optimistic on this version! Both my macOS and iOS targets now correctly show SwiftUI previews without erroring anymore.

Will keep testing...

I am also happy to report that I can again use SwiftUI previews with Xcode 14.2.